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

Add Channel param to config for google maps api script tag #87

Merged
merged 3 commits into from
Apr 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ In `config/environment.js` you can specify:
- additional Google Maps libraries to be loaded along with this add-on
(check the full list [here](https://developers.google.com/maps/documentation/javascript/libraries)),
- optional API key or client ID for your application (additional info could be found [here](https://developers.google.com/maps/web/)),
- optional [channel](https://developers.google.com/maps/premium/reports/usage-reports#channels),
- optional version number,
- optional exclude parameter, which prevents inclusion of the google maps api script tag into the index.html (in case one wants to handle loading of google maps lib by himself),
- optional language for map localization,
Expand Down
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ module.exports = {
params.push('client=' + encodeURIComponent(client));
}

var channel = gMapConfig.channel;
if (channel) {
params.push('channel=' + encodeURIComponent(channel));
}

var libraries = gMapConfig.libraries;
if (libraries && libraries.length) {
params.push('libraries=' + encodeURIComponent(libraries.join(',')));
Expand Down