Reputation: 5098
Is there a way to remove markers from a GMapPanel? I was looking through the GMapPanel code and only saw a function that hides the markers on the map. I'm trying to remove markers so i can re populate the map with new markers.
Upvotes: 0
Views: 1480
Reputation: 1293
addMarker : function(point, marker, clear, center, listeners){
Ext.applyIf(marker,G_DEFAULT_ICON);
if (clear === true){
this.getMap().clearOverlays();
}
if (center === true) {
this.getMap().setCenter(point, this.zoomLevel);
}
var mark = new GMarker(point,marker);
if (typeof listeners === 'object'){
for (evt in listeners) {
GEvent.bind(mark, evt, this, listeners[evt]);
}
}
this.getMap().addOverlay(mark);
},
it appears that .addMarker(false, false, true, false, false);
or try calling: this.getMap().clearOverlays();
Upvotes: 1