Skip to content

Commit

Permalink
perf(AgmMap): run resolve outside angular zone
Browse files Browse the repository at this point in the history
  • Loading branch information
PKromhout authored and sebholstein committed May 7, 2018
1 parent 1a74b3a commit 078c2a5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/core/services/google-maps-api-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ export class GoogleMapsAPIWrapper {
}

createMap(el: HTMLElement, mapOptions: mapTypes.MapOptions): Promise<void> {
return this._loader.load().then(() => {
const map = new google.maps.Map(el, mapOptions);
this._mapResolver(<mapTypes.GoogleMap>map);
return;
return this._zone.runOutsideAngular( () => {
return this._loader.load().then(() => {
const map = new google.maps.Map(el, mapOptions);
this._mapResolver(<mapTypes.GoogleMap>map);
return;
});
});
}

Expand Down

0 comments on commit 078c2a5

Please sign in to comment.