From 71791666032647876d111b0f6467708d803b5f31 Mon Sep 17 00:00:00 2001 From: pgiraud Date: Mon, 15 Feb 2010 09:05:49 +0000 Subject: [PATCH] adds a new getVisibility method in the Feature.Vector class, used in the SelectFeature control this method now allows us to tell the select feature box handler wether to select or not the features, r=ahocevar, (Closes #2418) git-svn-id: http://svn.openlayers.org/trunk/openlayers@10064 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- examples/select-feature.html | 11 +++++++- lib/OpenLayers/Control/SelectFeature.js | 5 ++++ lib/OpenLayers/Feature/Vector.js | 21 +++++++++++++++ tests/Feature/Vector.html | 34 +++++++++++++++++++++++++ 4 files changed, 70 insertions(+), 1 deletion(-) diff --git a/examples/select-feature.html b/examples/select-feature.html index c0cad3b457..f50b2ed930 100644 --- a/examples/select-feature.html +++ b/examples/select-feature.html @@ -21,6 +21,15 @@ ); var vectors = new OpenLayers.Layer.Vector("Vector Layer"); + vectors.events.on({ + 'featureselected': function(feature) { + $('counter').innerHTML = this.selectedFeatures.length; + }, + 'featureunselected': function(feature) { + $('counter').innerHTML = this.selectedFeatures.length; + }, + }); + map.addLayers([wmsLayer, vectors]); map.addControl(new OpenLayers.Control.LayerSwitcher()); @@ -125,7 +134,7 @@
  • - +