MBU
MBU

Reputation: 5098

Remove markers from a GMapPanel version 3. ExtJS

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

Answers (1)

Bas van Ommen
Bas van Ommen

Reputation: 1293

part of this link :

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

Related Questions