Skip to content

Commit

Permalink
fix(lazy-loader): check if google maps script was already loaded
Browse files Browse the repository at this point in the history
Check in lazy loader if google maps script was loaded and maps are initialized in window.

Fixes #692
  • Loading branch information
qfel13 authored and sebholstein committed Dec 2, 2017
1 parent b35d9bf commit e513c57
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ export class LazyMapsAPILoader extends MapsAPILoader {
}

load(): Promise<void> {
const window = <any>this._windowRef.getNativeWindow();
if (window.google && window.google.maps) {
// Google maps already loaded on the page.
return Promise.resolve();
}

if (this._scriptLoadingPromise) {
return this._scriptLoadingPromise;
}
Expand Down

0 comments on commit e513c57

Please sign in to comment.