Crush app with Google Maps when you re-enter the page on iOS
This happens only if an element is affixed to the map, for example, a marker.
Without a marker, there is no error.
Previously, everything worked fine.
The android works without problems.
Nobody faced such a problem?
import { Component } from '@angular/core';
import { GoogleMaps, GoogleMap, GoogleMapsEvent, GoogleMapsMapTypeId, LatLng, MarkerOptions } from '@ionic-native/google-maps';
@Component({
selector: 'page-map-route',
templateUrl: 'map-route.html',
})
export class MapRoutePage {
public map: GoogleMap;
mapDiv: HTMLElement;
marker: MarkerOptions
constructor(
private googleMaps: GoogleMaps
) { }
ionViewDidLoad() {
this.loadMap();
}
loadMap() {
this.mapDiv = document.getElementById('map');
let map_location: LatLng = new LatLng(43.2566700, 76.9286100);
let mapOptions = {
mapType: GoogleMapsMapTypeId.NORMAL,
controls: {
compass: false,
myLocationButton: true,
indoorPicker: false,
zoom: false
},
gestures: {
scroll: true,
tilt: true,
zoom: true,
rotate: true
},
styles: [],
camera: {
latLng: map_location,
tilt: 0,
zoom: 1,
bearing: 0
},
preferences: {
zoom: {
minZoom: 0,
maxZoom: 18
},
building: true
}
};
this.map = this.googleMaps.create(this.mapDiv, mapOptions);
this.map.one(GoogleMapsEvent.MAP_READY).then(() => {
alert('ready');
this.marker = {
position: map_location,
title: 'Test marker',
styles : {
'font-weight': 'bold',
'color': '#336600'
},
icon: {
'url': 'http://bvr.astanalux.kz/assets/images/start_point.png'
}
};
this.map.addMarker(this.marker);
});
}
}
Plugin bug fixed: https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1648