[OpenLayers-Commits] r6047 - sandbox/tschaub/events/lib/OpenLayers/Layer

commits at openlayers.org commits at openlayers.org
Thu Feb 7 18:58:11 EST 2008


Author: tschaub
Date: 2008-02-07 18:58:10 -0500 (Thu, 07 Feb 2008)
New Revision: 6047

Modified:
   sandbox/tschaub/events/lib/OpenLayers/Layer/Vector.js
Log:
Adding featuresadded method for vector layers.

Modified: sandbox/tschaub/events/lib/OpenLayers/Layer/Vector.js
===================================================================
--- sandbox/tschaub/events/lib/OpenLayers/Layer/Vector.js	2008-02-07 23:42:13 UTC (rev 6046)
+++ sandbox/tschaub/events/lib/OpenLayers/Layer/Vector.js	2008-02-07 23:58:10 UTC (rev 6047)
@@ -39,12 +39,18 @@
      *  - *loadend* Triggered when layer loading ends.
      *  - *loadcancel* Triggered when layer loading is canceled.
      *  - *visibilitychanged* Triggered when layer visibility is changed.
-     *  - *featureadded* Triggered after a feature is added.  The event
-     *      object passed to listeners will have a *feature* property with a
-     *      reference to the added feature.
+     *  - *featuresadded* Triggered after features are added.  The event
+     *      object passed to listeners will have a *features* property with a
+     *      reference to an array of added features.
+     *  - *featureselected* Triggered after a feature is selected.  Listeners
+     *      will receive an object with a *feature* property referencing the
+     *      selected feature.
+     *  - *featureunselected* Triggered after a feature is unselected.
+     *      Listeners will receive an object with a *feature* property
+     *      referencing the unselected feature.
      */
     EVENT_TYPES: ["loadstart", "loadend", "loadcancel", "visibilitychanged",
-                  "featureselected", "featureunselected"],
+                  "featuresadded", "featureselected", "featureunselected"],
 
     /**
      * APIProperty: isBaseLayer
@@ -311,6 +317,10 @@
                 this.onFeatureInsert(feature);
             }
         }
+        
+        if(notify) {
+            this.events.triggerEvent("featuresadded", {features: features});
+        }
     },
 
 



More information about the Commits mailing list