drag, rotate, resize, and reshape with the ModifyFeature control - thanks pvalsecc and elemoine for the inspiration, tests, and code - good partenering with you guys (closes #1150).

git-svn-id: http://svn.openlayers.org/trunk/openlayers@5301 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2007-11-30 17:09:23 +00:00
parent 600435ad21
commit 10cf5bfefc
5 changed files with 255 additions and 29 deletions

View File

@@ -307,12 +307,27 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, {
/**
* APIMethod: destroyFeatures
* Destroy all features on the layer and empty the selected features array.
* Erase and estroy features on the layer.
*
* Parameters:
* features - {Array(<OpenLayers.Feature.Vector>)} An optional array of
* features to destroy. If not supplied, all features on the layer
* will be destroyed.
*/
destroyFeatures: function () {
this.selectedFeatures = [];
for (var i = this.features.length - 1; i >= 0; i--) {
this.features[i].destroy();
destroyFeatures: function(features) {
var all = (features == undefined);
if(all) {
features = this.features;
this.selectedFeatures = [];
}
this.eraseFeatures(features);
var feature;
for(var i=features.length-1; i>=0; i--) {
feature = features[i];
if(!all) {
OpenLayers.Util.removeItem(this.selectedFeatures, feature);
}
feature.destroy();
}
},