File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ declare namespace google {
18
18
export const GoogleMapsOptions = object ( {
19
19
apiKey : string ( ) ,
20
20
libraries : optional ( array ( string ( ) ) ) ,
21
+ language : optional ( string ( ) ) ,
22
+ region : optional ( string ( ) ) ,
21
23
v : optional ( union ( [ literal ( 'weekly' ) , literal ( 'beta' ) , literal ( 'alpha' ) ] ) ) ,
22
24
} )
23
25
@@ -40,13 +42,17 @@ export function useScriptGoogleMaps<T extends GoogleMapsApi>(_options?: GoogleMa
40
42
let readyPromise : Promise < void > = Promise . resolve ( )
41
43
return useRegistryScript < T , typeof GoogleMapsOptions > ( 'googleMaps' , ( options ) => {
42
44
const libraries = options ?. libraries || [ 'places' ]
45
+ const language = options ?. language ? { language : options . language } : undefined
46
+ const region = options ?. region ? { region : options . region } : undefined
43
47
return {
44
48
scriptInput : {
45
49
src : withQuery ( `https://maps.googleapis.com/maps/api/js` , {
46
50
libraries : libraries . join ( ',' ) ,
47
51
key : options ?. apiKey ,
48
52
loading : 'async' ,
49
53
callback : 'google.maps.__ib__' ,
54
+ ...language ,
55
+ ...region ,
50
56
} ) ,
51
57
} ,
52
58
clientInit : import . meta. server
You can’t perform that action at this time.
0 commit comments