Revert "[New] raise feature function to move features in layer."

This reverts commit cb1c3a834a.

the drawing order is controlled by Renderer not the Layer classes
This commit is contained in:
mosesonline
2012-12-11 07:27:09 +01:00
parent 5bffb3dea3
commit 9ea9b85988
2 changed files with 2 additions and 77 deletions
+1 -22
View File
@@ -699,28 +699,7 @@ OpenLayers.Layer.Vector = OpenLayers.Class(OpenLayers.Layer, {
this.events.triggerEvent("featuresremoved", {features: features});
}
},
/**
* APIMethod: raiseFeature
* Changes the index of the given feature by delta and redraws the layer. If delta is positive, the feature is moved up the layer's feature stack; if delta is negative, the feature is moved down.
* If delta + current is negative it is set to 0 and feature will be at the bottom; if it is bigger then the features count than it is set to the last index and the feature will be at the top.
*/
raiseFeature:function(feature, delta) {
var base = this.features.indexOf(feature);
var idx = base + delta;
if (idx < 0) {
idx = 0;
} else if (idx > this.features.length) {
idx = this.features.length;
}
if (base != idx) {
this.features.splice(base, 1);
this.features.splice(idx, 0, feature);
this.eraseFeatures(this.features);
this.redraw();
}
},
/**
* APIMethod: removeAllFeatures
* Remove all features from the layer.