Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can't Get Google Map To Appear

  I’m new with Qlikview, using the personal edition to learn before buying it.   I attempted to create a map scatter
diagram following instructions from a white paper published by Qliktech.  I think I followed it correctly- the scatter
diagram shows bubble coordinates that make sense. Boston is in the upper right and Honolulu in the lower left, etc…

My problem is I can get the underlying Google map to appear I…

  • Activated webview
  • Copy – Pasted a set of commands from the white paper into edit script (too long to include here)
  • Created a gmap key from Google and inserted it into the right spot in the script
  • Copy and pasted the following image expression
  • Used the following expressions:
    • Longitude: round (256*pow(2,($(var_zoom)-1)))+( Longitude *((256*pow(2,$(var_zoom)))/360))
    • Latitude: ((256*pow(2,($(var_zoom)-1)))+((0.5*log((1+(sin((Latitude)*pi()/180)))/(1-(sin((Latitude)*pi()/180)))))*((-256*pow(2,$(var_zoom)))/(2*pi()))))
    • Customers: Count (distinct([Customer name])) //This is the bubble size expression

The data file I imported has a unique customer name, a latitude and longitude.  There’s mention
of a geokey and I’m wonder if that’s my problem but not sure what that is.

 

Is there something obvious I may have missed or a switch I ddn’t throw?  Better yet, an example I
can reverse engineer?

 

Thanks,

 

Mike

3 Replies
vikasmahajan

Hii

Please refer my link

http://community.qlik.com/docs/DOC-4594

I have attached demo for map.

Hope this resolve your issue.

Good Luck

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
Not applicable
Author

Hi Mike,

You haven't a good URL for the google image. Instead of

='http://maps.google.com/staticmap?center='&Replace(var_mid_lat,',','.')&','&Replace(var_mid_long,',',...

&'.jpg'

you need to put this expression :

='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'

For more information about the URL take a look at this documentation : Static Maps API Developer Guide - Google Maps Image APIs — Google Developers

I attach an example application.

Hope it helps.

Regards,

Nicolas

Not applicable
Author

I got a map to appear but when I attempt to zoom in, it doesn't expand (but the bubbles do).

Could it be a part of the reload?  I have a personal copy (while I decide whether to buy it) so I can't open your example.   Here's what I have in edit script which originated from a Qliktech White Paper.

gmap_key = 'AIzaSyCVReLvtPQEWY_jlhbVWMarEBrTSuUNrLI';

max_zoom_level = 14; //maximum value 17

def_zoom_level = 1;

def_map_size = 400;

// Variables required for calculating map

// No need to change these

var_pi180= '=pi()/180';

var_lat_offset= '0';

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

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

var_mid_lat= '=median(Latitude)';

var_mid_long= '=median(Longitude)';

var_zoom= '=If(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)) )

<def_map_size 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()))))<def_map_size,_zoom_level,null()),_zoom_level))>def_zoom_level,

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)) ) <def_map_size 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()))))<def_map_size,_zoom_level,null()),_zoom_level)),def_zoom_level)';

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

// Field required for calcualting best zoom level

SET HidePrefix='_' ;

_zoom_level:

Load RecNo( ) as _zoom_level autogenerate(max_zoom_level);

maptype:

LOAD * INLINE [

Maptype

roadmap

mobile

satellite

terrain

hybrid

]
;