@@ -33,6 +33,22 @@ export class LazyMapsAPILoaderConfig {
33
33
* Defines which Google Maps libraries should get loaded.
34
34
*/
35
35
libraries : string [ ] = [ ] ;
36
+
37
+ /**
38
+ * The default bias for the map behavior is US.
39
+ * If you wish to alter your application to serve different map tiles or bias the
40
+ * application, you can overwrite the default behavior (US) by defining a `region`.
41
+ * See https://developers.google.com/maps/documentation/javascript/basics#Region
42
+ */
43
+ region : string = null ;
44
+
45
+ /**
46
+ * The Google Maps API uses the browser's preferred language when displaying
47
+ * textual information. If you wish to overwrite this behavior and force the API
48
+ * to use a given language, you can use this setting.
49
+ * See https://developers.google.com/maps/documentation/javascript/basics#Language
50
+ */
51
+ language : string = null ;
36
52
}
37
53
38
54
const DEFAULT_CONFIGURATION = new LazyMapsAPILoaderConfig ( ) ;
@@ -90,6 +106,8 @@ export class LazyMapsAPILoader extends MapsAPILoader {
90
106
const hostAndPath : string = this . _config . hostAndPath || DEFAULT_CONFIGURATION . hostAndPath ;
91
107
const apiKey : string = this . _config . apiKey || DEFAULT_CONFIGURATION . apiKey ;
92
108
const libraries : string [ ] = this . _config . libraries || DEFAULT_CONFIGURATION . libraries ;
109
+ const region : string = this . _config . region || DEFAULT_CONFIGURATION . region ;
110
+ const language : string = this . _config . language || DEFAULT_CONFIGURATION . language ;
93
111
const queryParams : { [ key : string ] : string } = {
94
112
v : this . _config . apiVersion || DEFAULT_CONFIGURATION . apiKey ,
95
113
callback : callbackName
@@ -100,6 +118,12 @@ export class LazyMapsAPILoader extends MapsAPILoader {
100
118
if ( libraries != null && libraries . length > 0 ) {
101
119
queryParams [ 'libraries' ] = libraries . join ( ',' ) ;
102
120
}
121
+ if ( region != null && region . length > 0 ) {
122
+ queryParams [ 'region' ] = region ;
123
+ }
124
+ if ( language != null && language . length > 0 ) {
125
+ queryParams [ 'language' ] = language ;
126
+ }
103
127
const params : string = Object . keys ( queryParams )
104
128
. map ( ( k : string , i : number ) => {
105
129
let param = ( i === 0 ) ? '?' : '&' ;
0 commit comments