Skip to content

Commit

Permalink
feat(LazyMapsApiLoader): add the channel parameter
Browse files Browse the repository at this point in the history
closes #319
  • Loading branch information
Alex Weber authored and sebholstein committed May 17, 2016
1 parent 09e8413 commit 52fe30e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/services/maps-api-loader/lazy-maps-api-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ export class LazyMapsAPILoaderConfig {
*/
clientId: string = null;

/**
* The Google Maps channel name (for premium plans).
* A channel parameter is an optional parameter that allows you to track usage under your client
* ID by assigning a distinct channel to each of your applications.
*/
channel: string = null;

/**
* Google Maps API version.
*/
Expand Down Expand Up @@ -114,6 +121,7 @@ export class LazyMapsAPILoader extends MapsAPILoader {
const hostAndPath: string = this._config.hostAndPath || DEFAULT_CONFIGURATION.hostAndPath;
const apiKey: string = this._config.apiKey || DEFAULT_CONFIGURATION.apiKey;
const clientId: string = this._config.clientId || DEFAULT_CONFIGURATION.clientId;
const channel: string = this._config.channel || DEFAULT_CONFIGURATION.channel;
const libraries: string[] = this._config.libraries || DEFAULT_CONFIGURATION.libraries;
const region: string = this._config.region || DEFAULT_CONFIGURATION.region;
const language: string = this._config.language || DEFAULT_CONFIGURATION.language;
Expand All @@ -127,6 +135,9 @@ export class LazyMapsAPILoader extends MapsAPILoader {
if (clientId) {
queryParams['client'] = clientId;
}
if (channel) {
queryParams['channel'] = channel;
}
if (libraries != null && libraries.length > 0) {
queryParams['libraries'] = libraries.join(',');
}
Expand Down

0 comments on commit 52fe30e

Please sign in to comment.