Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(google-maps): @googlemaps/js-api-loader: Refactor to importLibrary method #1587

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions google-maps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
6 changes: 2 additions & 4 deletions google-maps/src/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
}
}
Expand Down
Loading