Hello, I’m simply trying to remove markers from my existing map. I feel like it should be easy. I tried 2 different methods but both get the same error:
Uncaught TypeError: Cannot read property 'apply' of undefined
First method
RemoveMarkers(){
while(this.markers.length > 20){
let tempMarker = this.markers.pop();
tempMarker.remove();
}
}
Second Method
let marker = new GoogleMapsMarker(markerOptions);
this.map.addEventListener(GoogleMapsEvent.MAP_CLICK).subscribe(() => {
marker.remove();
});
I can’t find anything online, and most similar questions don’t use Ionic-Native.
Thanks