Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

Commit 52fe30e

Browse files
Alex Webersebholstein
authored andcommitted
feat(LazyMapsApiLoader): add the channel parameter
closes #319
1 parent 09e8413 commit 52fe30e

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/services/maps-api-loader/lazy-maps-api-loader.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ export class LazyMapsAPILoaderConfig {
2222
*/
2323
clientId: string = null;
2424

25+
/**
26+
* The Google Maps channel name (for premium plans).
27+
* A channel parameter is an optional parameter that allows you to track usage under your client
28+
* ID by assigning a distinct channel to each of your applications.
29+
*/
30+
channel: string = null;
31+
2532
/**
2633
* Google Maps API version.
2734
*/
@@ -114,6 +121,7 @@ export class LazyMapsAPILoader extends MapsAPILoader {
114121
const hostAndPath: string = this._config.hostAndPath || DEFAULT_CONFIGURATION.hostAndPath;
115122
const apiKey: string = this._config.apiKey || DEFAULT_CONFIGURATION.apiKey;
116123
const clientId: string = this._config.clientId || DEFAULT_CONFIGURATION.clientId;
124+
const channel: string = this._config.channel || DEFAULT_CONFIGURATION.channel;
117125
const libraries: string[] = this._config.libraries || DEFAULT_CONFIGURATION.libraries;
118126
const region: string = this._config.region || DEFAULT_CONFIGURATION.region;
119127
const language: string = this._config.language || DEFAULT_CONFIGURATION.language;
@@ -127,6 +135,9 @@ export class LazyMapsAPILoader extends MapsAPILoader {
127135
if (clientId) {
128136
queryParams['client'] = clientId;
129137
}
138+
if (channel) {
139+
queryParams['channel'] = channel;
140+
}
130141
if (libraries != null && libraries.length > 0) {
131142
queryParams['libraries'] = libraries.join(',');
132143
}

0 commit comments

Comments
 (0)