Skip to content

Commit

Permalink
Bug fix: map.remove() generates empty map internally
Browse files Browse the repository at this point in the history
  • Loading branch information
wf9a5m75 committed Mar 28, 2018
1 parent 2e2716d commit 321f06f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/@ionic-native/plugins/google-maps/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1239,9 +1239,11 @@ export class BaseClass {
*/
@CordovaCheck({ sync: true })
destroy(): void {
let map: GoogleMap = this._objectInstance.getMap();
if (map) {
delete this._objectInstance.getMap().get('_overlays')[this._objectInstance.getId()];
if (this instanceof GoogleMaps.getPlugin().GoogleMap) {
let map: GoogleMap = this._objectInstance.getMap();
if (map) {
delete this._objectInstance.getMap().get('_overlays')[this._objectInstance.getId()];
}
}
this._objectInstance.remove();
}
Expand Down

0 comments on commit 321f06f

Please sign in to comment.