googledatalab / notebooks

Google Cloud Datalab samples and documentation
Apache License 2.0
341 stars 162 forks source link

Map charts don't load, missing key #74

Open yebrahim opened 7 years ago

yebrahim commented 7 years ago

Getting this error:

Google Maps API error: MissingKeyMapError https://developers.google.com/maps/documentation/javascript/error-messages#missing-key-map-error
_.kb @ js?v=3&callback=google.loader.callbacks.maps&sensor=false:37
(anonymous) @ common.js:53
(anonymous) @ common.js:194
c @ common.js:49
(anonymous) @ AuthenticationService.Authenticate?1shttp%3A%2F%2Flocalhost%3A8081%2Fnotebooks%2Fdev%2Fnotebooks%2F…:1
yebrahim commented 7 years ago

One work around here is to create your own key, embed it in the notebook before calling the %%chart magic by using an html cell (replace _API_KEY with your key string):

%%html

<script src="https://maps.googleapis.com/maps/api/js?key=_API_KEY_&callback=initMap" async defer></script>

See https://github.com/googledatalab/notebooks/pull/78 for more details.