I have 2 view controllers using the map but when I'm using the map.clear(), the markers are cleared but the circles and polylines remain.
I use the following code to initiate the map per controller and in some controller I set a map and polyline and the other I set markers and a new polyline.
// Canvas
var mapcanvas = document.getElementById("mapcanvas");
// Create map
map = window.plugin.google.maps.Map.getMap();
// Event - Map ready
map.on(plugin.google.maps.event.MAP_READY, function () {
console.log('map is ready');
// Clear the map first
map.clear();
map.refreshLayout(); // perhaps this is not necessary
// Configure map and set to DIV
map.setDiv(mapcanvas);
map.setOptions({
'controls': {
'compass': true,
'myLocationButton': false,
'indoorPicker': false,
'zoom': false
}
});
Hi,
I have 2 view controllers using the map but when I'm using the map.clear(), the markers are cleared but the circles and polylines remain.
I use the following code to initiate the map per controller and in some controller I set a map and polyline and the other I set markers and a new polyline.
not sure if i'm doing something wrong