OpenLayers OpenLayers

Changeset 7526

Show
Ignore:
Timestamp:
07/16/08 12:41:19 (2 months ago)
Author:
tschaub
Message:

Replacing featuresdestroyed with the already available featuresremoved event. Will need to revisit.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/topp/trimet/lib/OpenLayers/Layer/Vector.js

    r7523 r7526  
    512512    /** 
    513513     * APIMethod: destroyFeatures 
    514      * Erase and destroy features on the layer. 
     514     * Erase and destroy features on the layer.  The featuresremoved event 
     515     *     will be triggered unless the silent option is true. 
    515516     * 
    516517     * Parameters: 
     
    518519     *     features to destroy.  If not supplied, all features on the layer 
    519520     *     will be destroyed. 
    520      */ 
    521     destroyFeatures: function(features) { 
     521     * options - {Object} Options to control behavior while destroying features. 
     522     * 
     523     * Valid options: 
     524     * silent - {Boolean} Do not trigger any events while destroying.  Default 
     525     *     is false. 
     526     */ 
     527    destroyFeatures: function(features, options) { 
    522528        var all = (features == undefined); 
    523529        if(all) { 
     
    526532        } 
    527533        this.eraseFeatures(features); 
     534        if(!options || !options.silent) { 
     535            this.events.triggerEvent("featuresremoved", {features: features}); 
     536        } 
    528537        var feature; 
    529538        for(var i=features.length-1; i>=0; i--) { 
     
    534543            feature.destroy(); 
    535544        } 
    536         this.events.triggerEvent("featuresdestroyed", {features: this.features}); 
    537545    }, 
    538546