Lazy-maps-api-loader error
See original GitHub issueHi @SebastianM ,
I am using angular2-google-maps in ionic2/angular2 in which we need the map only in one page and it works fine too, but every consecutive visit to the same page gives me an error.
You have included the Google Maps API multiple times on this page. This may cause unexpected errors.
Please let me know if i am missing something.
Thanks
Issue Analytics
- State:
- Created 7 years ago
- Comments:19 (3 by maintainers)
Top Results From Across the Web
LazyMapsAPILoader is broken since 1.0.0 #1726 - GitHub
Hi,. Using a lazily-provided API key worked fine with 1.0.0-beta.7, but today (with version 1.0.0) it creates a compilation error: ERROR in app/ ......
Read more >loader - @agm/core
_assignScriptLoadingPromise(scriptElem: HTMLElement). Defined in packages/core/src/lib/services/maps-api-loader/lazy-maps-api-loader.ts:127. Parameters : ...
Read more >Errors installing google maps - Google Groups
I'm trying to install angular 2 google maps with the latest version of angular2 (rc4) and I`m constantly getting errors when installing it...
Read more >Load googlemaps api before AGM Map - Stack Overflow
The problem arises because the AgmCoreModule in the app.module takes care of loading the Google API like so: AgmCoreModule.
Read more >SebastianM/angular2-google-maps - Gitter
i have also changed LazyMapsAPILoader to MapsAPILoader like brunsten mention ... Maps API warning: NoApiKeys and Google Maps API error: MissingKeyMapError.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In your app.module.ts imports add:
AgmCoreModule.forRoot({ apiKey: 'xxxxxx', libraries: ['places'] })
(ofcourse you can remove libraries: [‘places’])
and then in a shared module add: in imports
AgmCoreModule
and in exports:AgmCoreModule
then the
You have included the Google Maps API multiple times on this page. This may cause unexpected errors.
will be gone@szykov The solution to using this angular2 component in a lazy loaded submodule is to do what @efstathiosntonas said
First, in your main
app.module.ts
, include the apiThen inside your submodule, include it again but without the API key
Now it will lazy load the angular2 maps component and only request the javascript once. I did this using webpack 2 and it works fine. Thanks guys for the good work here.