OpenLayers OpenLayers

Ticket #475: removeBox.patch

File removeBox.patch, 0.7 kB (added by euzuro, 2 years ago)

this patch adds a removeMarker() function to the boxes layer that works correctly

  • lib/OpenLayers/Layer/Boxes.js

    old new  
    4444        } 
    4545    }, 
    4646 
     47 
     48    /** OVERRIDDEN 
     49     *  
     50     * @param {OpenLayers.Marker} marker 
     51     */ 
     52    removeMarker: function(marker) { 
     53        OpenLayers.Util.removeItem(this.markers, marker); 
     54        if ((marker.div != null) && 
     55            (marker.div.parentNode == this.div) ) { 
     56            this.div.removeChild(marker.div);     
     57        } 
     58    }, 
     59 
    4760    /** @final @type String */ 
    4861    CLASS_NAME: "OpenLayers.Layer.Boxes" 
    4962});