Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
marcel_olmo
Partner Ambassador
Partner Ambassador

Why this typical Google Maps example doesn't work?

Hello Guys, I've just added the typical Google Maps Example and I cannot make it work. I think it's maybe because of the new version of QV 10.

Otherwise I cannot understand why the latitude and longitude showed are 0.

In the following example I just only add some example code of geocoding data and the typical code for a Google Maps QV Aplication.

I just cannot make it work and I don't understand why, in the first case, the latitude and longitude are 0, and in the second one the result cannot be shown.

Any ideas? Would be kindly appreciated.

Here I leave the code. cheers! :

Data:
LOAD * INLINE [
Country,Population,GDP_PPP_M, latitude, longitude
Albania, 3600523, 19621, 41.153332, 20.168331
Algeria, 33858000, 269201, 28.033886, 1.659626
Argentina, 40301927, 523169, -38.416097, -63.616672
Armenia, 3230100, 17139, 40.069099, 45.038189
Australia, 21446187, 760800, -25.274398, 133.775136
Austria, 8340924, 317800, 47.516231, 14.550072
Azerbaijan, 8629900, 64082, 40.143105, 47.576927
Bahrain, 760168, 24245, 25.930414, 50.637772
];

// Google Maps in QlikView
// V0.9 - 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 = 'ABQIAAAAz3xOFbWaADVwBmLMzSJPmhRi_j0U6kJrkFvY4-OX2XYmEAa76BTcfAuv2czfjGrx_DULHCHDEGsRSw';
max_zoom_level = 5; //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';

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
];

1 Solution

Accepted Solutions
Not applicable

Hi Marcel,

This issue is always the same problem.

Just change the setting

SET ThousandSep='.';
SET DecimalSep=',';

cheers

jjj

View solution in original post

5 Replies
marcel_olmo
Partner Ambassador
Partner Ambassador
Author

It's weird because I'm checking out with my work colleagues and everything seems to be fine. But it doesn't work.

Anybody knows why?

Many thanks per advance

Not applicable

Hi Marcel,

This issue is always the same problem.

Just change the setting

SET ThousandSep='.';
SET DecimalSep=',';

cheers

jjj

marcel_olmo
Partner Ambassador
Partner Ambassador
Author

Merci beaucoup Jean Jacques for your quick answer.

I tried to figure out what do you mean with "changing the default settings" of the Thousand separator and the Decimal separator.

What do you exactly mean? I tried many combination formating these separators and it still doesn't work.

Many thanks by advance.

Not applicable

Marcel,

Use a dot as decimal separator :

SET DecimalSep='.'

and set Thousand separator to

SET ThousandSep=' ';

hope it works.

JJJ

marcel_olmo
Partner Ambassador
Partner Ambassador
Author

Many thanks Jean Jacques.

Now it works fine. I cannot understand why it's so important this little stuff, but, thank you very much, you save me a big headacke.

See you around.

Cheers!