give ModifyFeature control a vertexRenderIntent property. r=tschaub (closes #2955)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10938 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -113,6 +113,15 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
* {Object} A symbolizer to be used for virtual vertices.
|
||||
*/
|
||||
virtualStyle: null,
|
||||
|
||||
/**
|
||||
* APIProperty: vertexRenderIntent
|
||||
* {String} The renderIntent to use for vertices. If no <virtualStyle> is
|
||||
* provided, this renderIntent will also be used for virtual vertices, with
|
||||
* a fillOpacity and strokeOpacity of 0.3. Default is null, which means
|
||||
* that the layer's default style will be used for vertices.
|
||||
*/
|
||||
vertexRenderIntent: null,
|
||||
|
||||
/**
|
||||
* APIProperty: mode
|
||||
@@ -193,11 +202,14 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
* control.
|
||||
*/
|
||||
initialize: function(layer, options) {
|
||||
options = options || {};
|
||||
this.layer = layer;
|
||||
this.vertices = [];
|
||||
this.virtualVertices = [];
|
||||
this.virtualStyle = OpenLayers.Util.extend({},
|
||||
this.layer.style || this.layer.styleMap.createSymbolizer());
|
||||
this.layer.style ||
|
||||
this.layer.styleMap.createSymbolizer(null, options.vertexRenderIntent)
|
||||
);
|
||||
this.virtualStyle.fillOpacity = 0.3;
|
||||
this.virtualStyle.strokeOpacity = 0.3;
|
||||
this.deleteCodes = [46, 68];
|
||||
@@ -622,6 +634,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
if(geometry.CLASS_NAME == "OpenLayers.Geometry.Point") {
|
||||
vertex = new OpenLayers.Feature.Vector(geometry);
|
||||
vertex._sketch = true;
|
||||
vertex.renderIntent = control.vertexRenderIntent;
|
||||
control.vertices.push(vertex);
|
||||
} else {
|
||||
var numVert = geometry.components.length;
|
||||
@@ -633,6 +646,7 @@ OpenLayers.Control.ModifyFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
if(component.CLASS_NAME == "OpenLayers.Geometry.Point") {
|
||||
vertex = new OpenLayers.Feature.Vector(component);
|
||||
vertex._sketch = true;
|
||||
vertex.renderIntent = control.vertexRenderIntent;
|
||||
control.vertices.push(vertex);
|
||||
} else {
|
||||
collectComponentVertices(component);
|
||||
|
||||
Reference in New Issue
Block a user