Using Google Map JavaScript library with cordova -


i trying use google map javascript api cordova project,

i getting map, after few seconds, getting referernotallowedmaperror file:///android_asset/www/index.html

i tried provide url on developer console also, no luck.

i tried provide wild card asterisk symbol

is there other way set custom referrer or how solve this?

---edit---

i using browser api key, changed android api key works fine.

wrong value cordova: https://maps.googleapis.com/maps/api/js?key=<browser api key>

proper value cordova: https://maps.googleapis.com/maps/api/js?key=<android api key>

browser api key seems allowed when html page executed on http url

as of may 2017, issue has been solved google. can use file:/ referrers api keys. can see following text in documentation

file:// referers need special representation added key restriction. "file:/" part should replaced "__file_url__" before being added key restriction. example, "file://path/to/" should formatted "__file_url__/path/to/*". after enabling file:// referers, recommended regularly check usage, make sure matches expectations

https://developers.google.com/maps/documentation/javascript/get-api-key#key-restrictions


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -