This repository was archived by the owner on Jun 23, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
src/services/maps-api-loader Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments