-
Notifications
You must be signed in to change notification settings - Fork 44
feat: Google Maps npm library updates #151
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| import '@capacitor/google-maps'; | ||
|
|
||
| declare global { | ||
| declare module "react" { | ||
| namespace JSX { | ||
| interface IntrinsicElements { | ||
| 'capacitor-google-map': React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>; | ||
| "capacitor-google-map": React.DetailedHTMLProps< | ||
| React.HTMLAttributes<HTMLElement>, | ||
| HTMLElement | ||
| >; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| export {}; | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -122,13 +122,13 @@ export class CapacitorGoogleMapsWeb extends WebPlugin implements CapacitorGoogle | |
| private async importGoogleLib(apiKey: string, region?: string, language?: string) { | ||
| if (this.gMapsRef === undefined) { | ||
| const lib = await import('@googlemaps/js-api-loader'); | ||
| const loader = new lib.Loader({ | ||
| apiKey: apiKey ?? '', | ||
| version: 'weekly', | ||
| lib.setOptions({ | ||
| key: apiKey ?? '', | ||
| language, | ||
| region, | ||
| }); | ||
| this.gMapsRef = await loader.importLibrary('maps'); | ||
|
|
||
| this.gMapsRef = await lib.importLibrary('maps'); | ||
|
Comment on lines
+125
to
+131
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: Looks like this ends up addressing #147 (for which there was an alternative PR, that I guess becomes obsolete if this gets merged). The PR title may need a rename because of this - explicitly mention updates to google maps, mention refactor of loader? Idk, I'll leave it to you @theproducer heh |
||
|
|
||
| // Import marker library once | ||
| const { AdvancedMarkerElement, PinElement } = (await google.maps.importLibrary( | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.