Qlik Community

Qlik DataMarket Discussions

Discussion Board for collaboration regarding Qlik DataMarket.

Not applicable

Google Map

I am trying to implement google map and followed the pdf (Step-by-Step Google Map API v3 integration)  but still the result is not upto the mark what i was expecting . I am sharing the screenshot of my o/p .gmap.PNG

My code is :

// Google Maps Key

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

gmap_key = 'ABQIAAAAPTYGDOAE5g8mVF5kIaY54RSHwNu1JdqUbdjDP-YY4oym4d2mTxSRdsISI-1rwwnl-9gjJrMO3oTkMA';

max_zoom_level = 17; //maximum value 17

//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= '=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 ];

set hideprefix = 'maptype';

My attaching the pdf file as well.

Please help me asap.

3 Replies
vikasmahajan
Honored Contributor III

Re: Google Map

Not applicable

Re: Google Map

Hi ,

Hi Vikas,

As  I am working on personal edition . i wont be able to open qvw's . Please if possible share the screenshots here.

vikasmahajan

sacosta5
New Contributor III

Re: Google Map

Hi Neha...

change Dynamic Image:

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

Community Browser