Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Google API Key / Using Google Maps

Hi,

Have looked at a number of QV documents that are using Google Maps / scattergraphs.  The majority of the documents that I view, only display the scattergraph element and not the map itself.

1) Is this due to the fact im using the old QV v8.5 or is it linked to the fact I have not entered / updated the Google API Key?

2) Looking at the sign up process to get an API Key, it asks you for the URL where the QV doc is hosted.  As I am developing it locally on my machine, then it will be hosted on the intranet - do I therefore need to get the Google Maps API Premier - or is there another way around this?  Or what URL do I enter?

Looking at the following QV doc posted by "Sri Vidya" http://community.qlik.com/message/97099#97099, the "google_loc.qv" doc uses the following script which i'm led to believe removes the requirement for a key?

              gmap_key = 'xx';

but again this doc doesn't display the background map, just the scatterchart.  - a QV v8.5 issue?

Have found links to Rob Wunderlich's cookbook, and found an example that doesn't require an API Key.  Have adapted it to include europe and countries, but was wondering whether region could be included in this manner?  ie GB-LND for London, as hinted in the http://code.google.com/intl/nl/apis/chart/image/docs/gallery/new_map_charts.html .

Adapting the attached file to incorporate a few European regions, (ie GB-LND), im unable to return the data correctly

Any tips greatly appreciated,

Kind regards,

Rich

1 Solution

Accepted Solutions
Not applicable
Author

See this site http://code.google.com/intl/es-ES/apis/chart/image/docs/gallery/new_map_charts.html#zoomcenter

and look for: cht=map:fixed=-60,0,80,-35

It show an example of use to adapt de zoom based in latitude and longitude.

Other changed i made was use | as symbol to concatenate region_codes.

Hope all this can help you.

Regards

View solution in original post

11 Replies
Not applicable
Author

with attachement...

Not applicable
Author

Hi

i am using the "old" script and i want to switch to your map in your attach.

i am using this values in my MAP

Data:

LOAD * INLINE [

COUNTRY_CODE,latitude, longitude

1110,33,65

779,41,20

1183,28,3

114,42.5,1.6

how can implement this in your map ?

thank you

Not applicable
Author

Hi Grahum,

Am quite new to Google Maps, but more than happy to share what I found out so far....

nb this technique was derived by reviewing Rob Wunderlich's cookbook...

There appears to be a limited amount of background maps available, ie "usa" (which breaks down the various states, "europe" (at country level only?), please see the attached link for a listing of the various maps available

http://code.google.com/apis/chart/image/docs/gallery/map_charts.html

This technique doesn't use longitude and latitude co-ordinates, just needs to have an associated ISO country code to appear on the map - have a look at my "inline" load.

What I am unsure about, is whether by using this technique, countries can further be broken down into the various regions, ie GB-LDN as implied by the google documentation?

Hope this helps, and hopefully someone can advise us whether the use of "GB-LDN" in the data load, will populate cities on the map??

Kind regards,

Rich

Not applicable
Author

Grahum,

One important thing that I read, but forgot to include in the above, is that the encoding used to interrogate the google system, only allows up to a maximum of 61-63 points (my memory fails, but its in the early 60's) on the map.  Should you require additional points /country to be displayed, then perhaps a different approach is required..

Not applicable
Author

Hi RichSheppard, try with this:

='http://chart.apis.google.com/chart?&cht=t'

& '&chs=' & '440x220' /* CHart size */

& '&cht=map'

& '&chco=' & 'B3BCC0|5781AE|FF0000|FFC726|885E80|518274'  /* Color for no value */

& ',' & 'A59D95,1E9D8B,003946'  /* Color gradient */

& '&chld=' & concat(DISTINCT region_codes, '|', fieldIndex('region_code', region_codes))

Not applicable
Author

Hi "thefourth",

Thanks for your reply, certainly this approach does allow the map to display the various cities as requested!

What changes did you make to the code? 

From what I can see, the "fieldIndex" needs to return 'region_code' and not 'region_codes' - what is the reasoning behind this (ie is this a google requirement)?

also the previous "chtm=europe" has been changed to "cht=map"

How do I adapt the script so that when displaying the various cities either you can control how much of the map is visible?

ie in the attached example, when Lisbon, London and Paris are selected/returned in the map, only Lisbon and London are visible (and Paris, is displayed outside of the visible area)?

Once again, many thanks

Rich

Not applicable
Author

with updated attachment factoring in cities into the map...

Not applicable
Author

See this site http://code.google.com/intl/es-ES/apis/chart/image/docs/gallery/new_map_charts.html#zoomcenter

and look for: cht=map:fixed=-60,0,80,-35

It show an example of use to adapt de zoom based in latitude and longitude.

Other changed i made was use | as symbol to concatenate region_codes.

Hope all this can help you.

Regards

francescopuppin
Contributor III
Contributor III

Hi guys,

I have the same question as Rich. Therefore, instead of opening a new thread, I am jumping into his thread.

I am still a bit confused about the key: is it actually needed to get a key, or the dummy one (gmap_key = 'xx') is OK?

And if it's needed, what is the URL to insert, knowing that Qlikview is not a web page?

By the way, I am a self-learner based on the Personal Edition, therefore I am not abe to open the attachments above: please accept my apologies if the answer is inside the files

Thanks

Francesco