diff --git a/google-maps/package.json b/google-maps/package.json index 91ffeef32..8a51a5214 100644 --- a/google-maps/package.json +++ b/google-maps/package.json @@ -93,8 +93,8 @@ "access": "public" }, "dependencies": { - "@googlemaps/js-api-loader": "~1.13.7", + "@googlemaps/js-api-loader": "~1.16.2", "@googlemaps/markerclusterer": "~2.0.7", - "@types/google.maps": "~3.50.5" + "@types/google.maps": "~3.53.4" } } diff --git a/google-maps/src/web.ts b/google-maps/src/web.ts index 5b82addec..2fcdbb432 100644 --- a/google-maps/src/web.ts +++ b/google-maps/src/web.ts @@ -39,7 +39,7 @@ export class CapacitorGoogleMapsWeb extends WebPlugin implements CapacitorGoogleMapsPlugin { - private gMapsRef: typeof google.maps | undefined = undefined; + private gMapsRef: google.maps.MapsLibrary | undefined = undefined; private maps: { [id: string]: { element: HTMLElement; @@ -126,12 +126,10 @@ export class CapacitorGoogleMapsWeb const loader = new lib.Loader({ apiKey: apiKey ?? '', version: 'weekly', - libraries: ['places'], language, region, }); - const google = await loader.load(); - this.gMapsRef = google.maps; + this.gMapsRef = await loader.importLibrary('maps'); console.log('Loaded google maps API'); } }