Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Google map is not displaying properly.

I used the below code in my application to display the map but it was just showing the bubbles only .  Not the map, I need to show a demo on how to integrate

the google map with QV 11 to my management with some Sales figure .   Somewhere I read API V3 to be used but there is no clarity on how to integrate it .

Please don't share the qvw file as I couldn't open . If you can paste the code here would be helpful.

Can someone pl help.

//===========================================================

// Google Maps in QlikView

// V0.85.2 - October 1st 2008  © Copyright QlikTech International AB 2008 / AES

// Google Maps Key

// get a key here http://code.google.com/apis/maps/signup.html

gmap_key = <I supplied the key here>

max_zoom_level = 17; //maximum value 17

// Variables required for calculating map

// No need to change these

var_pi180=        '=pi()/180';

var_lat_offset=    '0';

var_long_offset = '0' ;

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

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

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))';

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

map_size_x=        '640';

map_size_y=     '400';

SET HidePrefix='_' ;

// Field required for calcualting best zoom level

_zoom_level:

LOAD RecNo() AS _zoom_level AutoGenerate(max_zoom_level);

maptype:

LOAD * INLINE [

    maptype

    roadmap

    mobile

    satellite

    terrain

    hybrid];

   

   

    LOAD * INLINE [

Customer,longitude,latitude,Sales

A-2-Z Solutions,255.7215289,193.6156805,$343,080

A-ARVIN Laser Resources,149.1185778,193.8956368,$8,570

A Superior System,273.9249778,160.2935876,$206,122

A&B,510.4355556,389.1459995,$233,533

A&G,273.8488889,160.0671736,$29,407

A&R Partners,116.97408,210.5743431,$94,298

A1 Datacom Supply,255.7215289,193.6156805,$719,334

a2i,123.7016178,184.0182003,$1,603

A2Z Solutions,447.0129778,203.584361,$118,897

AA-Wizard,255.8215111,170.2507825,$210,151

Aadast,273.8157511,160.2736679,$559,991

Aaron D. Meyer & Associates,455.5259733,201.4449869,$171,168

Aaron Products,445.9318044,205.3413254,Aaron Products : $7,443

];

1 Solution

Accepted Solutions
Siva_Sankar
Master II
Master II

ok, open your application.  under colors tab, in dynamic image expression copy paste the following. ='http://maps.googleapis.com/maps/api/staticmap?center=' &  num(var_mid_lat, '##############', '.', ',' )  &  ','  &  num(var_mid_long, '##############', '.', ',' )  &  '&zoom='& $(var_zoom) & '&maptype='& (var_maptype) & '&size=400x400' &  '&sensor=false'

View solution in original post

16 Replies
Siva_Sankar
Master II
Master II

Did you genereate the key from http://code.google.com/apis/maps/signup.html and pasted the key in the code gmap_key = ? Regards siva

Not applicable
Author

yes I did, this I mentioned it in my above post  -  gmap_key = <I supplied the key here>

I was able to see the map a month ago but now the map is not visible but only the bubbles are visible.



Siva_Sankar
Master II
Master II

in the colors tab, set the transparency to 0% and check. Regards. siva

Not applicable
Author

Its already 0% only

Siva_Sankar
Master II
Master II

I couldnt figure out the issue from your code. I am attaching a sample file. You can either compare the code with your existing code or you can copy, paste the Map from the QVW to yours and change the data. Regards. siva

Not applicable
Author

Thanks for your reply Siva.

I couldn't open your app.  Am attaching my qvw, please review and let me know if I need to make any changes ... 

Refer Copy of Sheet2 and Map tab

Also let me know if you can see the map from your system.?

Note: Since I couldn't open the qvw's can you jot down the changes in the email itself.

Regards

Sasken

Siva_Sankar
Master II
Master II

Find the attachment. try relloading and test. Regards. siva

Not applicable
Author

Siva

I couldn't open this document as I mentioned earlier.

Could you pl copy paste the changes that you made it to the doc. so that I can include & retest it

Thanks

Sasken

Siva_Sankar
Master II
Master II

ok, open your application.  under colors tab, in dynamic image expression copy paste the following. ='http://maps.googleapis.com/maps/api/staticmap?center=' &  num(var_mid_lat, '##############', '.', ',' )  &  ','  &  num(var_mid_long, '##############', '.', ',' )  &  '&zoom='& $(var_zoom) & '&maptype='& (var_maptype) & '&size=400x400' &  '&sensor=false'