airbnb / AirMapView

A view abstraction to provide a map user interface with various underlying map providers
http://airbnb.github.io/AirMapView/
Apache License 2.0
1.87k stars 215 forks source link

Google Maps JavaScript API warning: NoApiKeys #131

Open peterszaszlateral opened 5 years ago

peterszaszlateral commented 5 years ago

Hi,

For some reason I can't get to make the JavaScript Google maps to work.

I created a totally new account in Google Cloud Console and created all the necessary setup including the billing system.

For some reason the Web Maps are still throwing this Google Maps JavaScript API warning: NoApiKeys exception and the map is showing up with a dark grey overlay on top of it, stating that the maps is only for Development Purposes.

I am using the sample app and I am getting these same results.

nwadams commented 5 years ago

Google likely changed their policies on google maps API. and you likely need to add the API key to the js. https://developers.google.com/maps/documentation/javascript/get-api-key. and set it as a key param in https://github.com/airbnb/AirMapView/blob/30e44de7fdbca00c263eaea76090d6b248418fa6/library/src/main/assets/google_map.html#L13.

There is probably a way to inject the key so you wouldn't need to modify the library.

dneykov commented 5 years ago

Did anyone manage to set api key to the web view map?

dneykov commented 5 years ago

I manage to se api key without modifying the library. Just create assets folder in your app and copy google_map.html and include api key in script tag.