popcorn-js
popcorn-js copied to clipboard
Google Maps plugin to include API Key
Google Maps API requires an API key and billing details to be activated. Plugin needs some refactoring work to allow API keys, see documentation for further details.
@menismu I made some simple changes that kind of work. There are some problems however:
- it's not possible to get the tests to work without committing an ApiKey to git, which doesn't seem like a good choice
- ~as currently written, users have to add an api key property to every instance of hte google map plugin. This is awkward and error-prone~ (EDIT: see below)
I'd like to make two changes to improve the situation:
- ~allow the API key to be passed as a global parameter when Popcorn is initialized, so that the key can be written out just a single time~ Actually, this is already possible with the
.defaults()method. So this just needs to be documented; - add
dotenvas a node dependency so that the apikey can be stored in a.envfile. devs will have to register individually for an API key, but that doesn't seem like such a huge burden and on balance is better than what we have, I think. However, I'm not familiar with qunit, so am not sure how to inject that value into web pages; and also the example page (popcorn.googlemaps.html) will still break, though perhaps that can be easily rewritten to indicate that an API key is necessary.
If you approve of that direction, I'll start on the changes right away. please let me know if you can. thanks!
I think this can be closed now?