From 52fe30e6ecbe1028731cf2f5ffa5b68eda5437e9 Mon Sep 17 00:00:00 2001 From: Alex Weber Date: Thu, 5 May 2016 08:02:32 -0300 Subject: [PATCH] feat(LazyMapsApiLoader): add the channel parameter closes #319 --- src/services/maps-api-loader/lazy-maps-api-loader.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/services/maps-api-loader/lazy-maps-api-loader.ts b/src/services/maps-api-loader/lazy-maps-api-loader.ts index dc442102c..21c01bdf3 100644 --- a/src/services/maps-api-loader/lazy-maps-api-loader.ts +++ b/src/services/maps-api-loader/lazy-maps-api-loader.ts @@ -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. */ @@ -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; @@ -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(','); }