Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

QV 9.0 Google Map Integration -Static Map V2

QV 9.0 Google Map Integration

gmap_key = '';(I have used crypto key)

max_zoom_level = 17; //maximum value 17

var_pi180=                          '=pi()/180';

var_lat_offset=                '0';

var_mc2=                            '=256*pow(2,$(var_zoom))';

var_mc1=                            '=256*pow(2,($(var_zoom)-1))';

var_maptype=  '=if(isnull(only(maptype)),fieldvalue(
'&chr(39)&'maptype'&chr(39)&', 1 ),maptype)';

map_size_x=         '640';

map_size_y=     '640';

var_mid_lat=     '=min(Latitude)+(1+var_lat_offset)*((max(Latitude)-min(Latitude))/2)';

var_mid_long= '=min(Longitude)+(max(Longitude)-min(Longitude))/2';

var_zoom=                         '=max(aggr(if(max(round(256*pow(2,(_zoom_level
-1)))+(Longitude *((256*pow(2,_zoom_level ))/360)) )-min(
round(256*pow(2,(_zoom_level -1)))+(Longitude
*((256*pow(2,_zoom_level ))/360)) ) < map_size_x AND max((256*pow(2,(_zoom_level-1)))+((0.5*log((1+(sin((Latitude)*pi()/180)))/(1-(sin((Latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))-min((256*pow(2,(_zoom_level-1)))+((0.5*log((1+(sin((Latitude)*pi()/180)))/(1-(sin((Latitude)*pi()/180)))))*((-256*pow(2,_zoom_level))/(2*pi()))))<
map_size_y,_zoom_level,1),_zoom_level))';

SET HidePrefix='_' ;

_zoom_level:

Load RecNo( ) as _zoom_level autogenerate(max_zoom_level);

maptype:

LOAD * INLINE [

    maptype, maptype_f

    roadmap, Road

                mobile,
Mobile

                satellite,
Satellite

                terrain,
Terrain

                hybrid,
Hybrid

];

MilesArea:

LOAD * INLINE [

MilesArea

10

20

30

40

50

100

200

10000

];

The below code -I am using in the chart  to display the map

='http://maps.googleapis.com/maps/api/staticmap?center='

&

num(var_mid_lat, '##############', '.', ',' )

&

','

&

num(var_mid_long, '##############', '.', ',' )

&

'&zoom=$(var_zoom)'

&

'&maptype='&var_maptype

&

'&size='&map_size_x&'x'&map_size_y

&

'&sensor=false' & '&.jpg'

If I use the Gmap key - Map is not showing.

When we select 10000 miles all bubbles are setting out of  USA map.

    

Zoom is also not working correctly.

Static Map V2 - It will be really great if I get any help .

0 Replies