Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How work with Geochart in the ng2-google-charts? #23

Closed
jhonieldor opened this issue May 11, 2017 · 6 comments
Closed

How work with Geochart in the ng2-google-charts? #23

jhonieldor opened this issue May 11, 2017 · 6 comments

Comments

@jhonieldor
Copy link

I´m trying to work with GeoChart, but I´m facing two issues. First, seems that be must declared the google map API-KEY on index.html, but working with a simple example like demonstrated on https://developers.google.com/chart/interactive/docs/gallery/geochart,is not necessary the API-KEY. Second, after declare the API-KEY on index.html, appears in console that world_COUNTRIES.js and countries_en.js not loading. Consequently, instead of appears the map from geochart package, appears "Requested map does not exist".

@gmazzamuto
Copy link
Owner

This seems related to google/google-visualization-issues#2292

Apparently an API-KEY is now needed. Unfortunately I am unable to reproduce your problem unless you post some code.

@yhedaoo
Copy link

yhedaoo commented Jun 24, 2017

I seem to have the same issue.
in html: <google-chart [data] = "geoData">

in TS:
private geoData:{
chartType:'geochart',
mapsApiKey: 'xxx',
dataTable:[
['City', 'Population'],
['Melbourne', 456789]
],
options:{
'region':53,
'displayMode':'markers'
}
}

@winni4eva
Copy link

winni4eva commented Jun 27, 2017

Am facing this same issue, how can I get the api key set?

tried this in my index.html but still not working..

 <script src="https://www.google.com/jsapi"></script>
<script>
google.load('visualization', '1.0', {
    'packages': ['corechart'],
    'mapsApiKey': 'your-api-key'
});
</script>

This helped to set the key but am still getting the mapsApiKeyError

   google.load('visualization', '1.0', {
       'packages': ['corechart'],
       'other_params': 'key=your-api-key'
   });
   console.log(google);

@felipecespedes
Copy link
Contributor

Hi, I've created an example of a GeoChart, the API key is not necessary.
see https://embed.plnkr.co/MtGEf8zM7AOaGZKX9aXT/

@winni4eva
Copy link

Thanks I got it working now without the api keys.

gmazzamuto added a commit that referenced this issue Feb 19, 2018
@ewwwgiddings
Copy link

For anyone here wondering why the API key warning comes up if they're using their own data but not in the example, make sure your country names match what Google reads them as. If you supply a country name Google doesn't recognize immediately is when the API key error will show. For example, Russia should be 'Russia' not something like 'Russian Federation'.

Hope this helps someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants