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
This commit is contained in:
@@ -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 @@
|
||||
<li>
|
||||
<input type="radio" name="type" value="select" id="selectToggle"
|
||||
onclick="toggleControl(this);" />
|
||||
<label for="selectToggle">select feature</label>
|
||||
<label for="selectToggle">select feature (<span id="counter">0</span> features selected)</label>
|
||||
<ul>
|
||||
<li>
|
||||
<input id="box" type="checkbox" checked="checked"
|
||||
|
||||
Reference in New Issue
Block a user