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: 
stephenedberkg
Creator III
Creator III

Google Map implementation

i am trying to implement the Google map but i cant get the latitude and longitude

my script is below

// Google Maps Key

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

// gmap_key = 'xx';

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

SETHidePrefix='_' ;

// Field required for calcualtingbest 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';

7 Replies
jsingh71
Partner - Specialist
Partner - Specialist

Hi,

You need to load Latitude and longitude values separately. Are you loading these values?

vikasmahajan

Google Map for India

Go through this

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.
stephenedberkg
Creator III
Creator III
Author

i am not loading any values. i think this script is take the latitude and longitude values automatically for area Location wise.. 

Is it take automatically or not?

vikasmahajan

why you want automatically ????

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.
stephenedberkg
Creator III
Creator III
Author

latitude and longitude values

mohammadkhatimi
Partner - Specialist
Partner - Specialist

Hie...

PFA is the example on Google Map implementation

Hope this will helps you...!!!

Regards,

Mohammad

stephenedberkg
Creator III
Creator III
Author

i am using trial version so cant open that QVW files.

i tried to implement this attached document wise but the map is not showing.

i am not set the google map api key.

Is it problem?