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 @@
  • - +