Skip to content

Commit

Permalink
feat(google-maps): @googlemaps/js-api-loader: Refactor to importLibra…
Browse files Browse the repository at this point in the history
  • Loading branch information
rcherukuri-sta committed Apr 27, 2024
1 parent 6a6291a commit aa2ffea
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1169,4 +1169,3 @@ but the current specification only allows X, Y, and (optionally) Z to be defined
| **`None`** | <code>'None'</code> | No base map tiles. |

</docgen-api>

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
"@types/node": "^20.11.25",
"husky": "^9.0.1",
"lerna": "^8.1.2",
"regexp-to-ast": "^0.5.0",
"typescript": "^5.4.2"
},
"engines": {
"node": ">=20",
"pnpm": ">=8"
},
"dependencies": {},
"workspaces": [
"plugin"
]
Expand Down
4 changes: 2 additions & 2 deletions plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,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 plugin/src/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import type {
} from './implementation';

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 @@ -113,12 +113,10 @@ export class CapacitorGoogleMapsWeb extends WebPlugin implements CapacitorGoogle
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

0 comments on commit aa2ffea

Please sign in to comment.