"users should be able to customize the select style per feature": Created a !StyleMap class which stores all styles that are needed for a layer. Controls that need to render features differently can now just give a render intent (e.g. "default", "select" or "temporary") to the layer's drawFeature method, instead of having extra style informations like Control.!SelectFeature.selectStyle. Existing application that set layer.style or feature.style are still supported, but both of these style properties are now null by default. r=crschmidt,elemoine,tschaub (closes #1120)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@6240 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -167,7 +167,8 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
this.layer = layer;
|
||||
this.vertices = [];
|
||||
this.virtualVertices = [];
|
||||
this.styleVirtual = OpenLayers.Util.extend({}, this.layer.style);
|
||||
this.styleVirtual = OpenLayers.Util.extend({},
|
||||
this.layer.style || this.layer.styleMap.createSymbolizer());
|
||||
this.styleVirtual.fillOpacity = 0.3;
|
||||
this.styleVirtual.strokeOpacity = 0.3;
|
||||
this.deleteCodes = [46, 100];
|
||||
@@ -409,7 +410,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
this.layer.destroyFeatures(this.virtualVertices);
|
||||
this.virtualVertices = [];
|
||||
}
|
||||
this.layer.drawFeature(this.feature, this.selectControl.selectStyle);
|
||||
this.layer.drawFeature(this.feature, this.selectControl.renderIntent);
|
||||
}
|
||||
// keep the vertex on top so it gets the mouseout after dragging
|
||||
// this should be removed in favor of an option to draw under or
|
||||
@@ -496,7 +497,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
// remove the vertex
|
||||
vertex.geometry.parent.removeComponent(vertex.geometry);
|
||||
this.layer.drawFeature(this.feature,
|
||||
this.selectControl.selectStyle);
|
||||
this.selectControl.renderIntent);
|
||||
this.resetVertices();
|
||||
this.onModification(this.feature);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user