[OpenLayers-Users] modifyFeature and style
longsen
945070223 at qq.com
Sun Apr 7 02:28:41 PDT 2013
if I don't use style on vector layer ,ModifyFeature control works well.
but if I use a default style.
it don't work!can only selected but cann't modify! OL2.12
var vector_line_layer = new OpenLayers.Layer.Vector(type);
var vector_line_style = new OpenLayers.Style({
strokeColor : "#00FFFF",
strokeWidth : 3,
strokeDashstyle : "longdash"
});
var vector_style_map = new OpenLayers.StyleMap({
'default' : vector_line_style
});
vector_line_layer.styleMap = vector_style_map;
map.addLayer(vector_line_layer);
lineControl = new OpenLayers.Control.DrawFeature(vector_line_layer,
OpenLayers.Handler.Path);
map.addControl(lineControl);
lineControl.activate();
modifyControl = new OpenLayers.Control.ModifyFeature(
vector_line_layer,{geometryTypes: ["OpenLayers.Geometry.LineString"]});
map.addControl(modifyControl);
modifyControl.mode=OpenLayers.Control.ModifyFeature.RESHAPE;
modifyControl.activate();
------------------
========================================================================================
OpenGSC
专注OGC,玩儿转开源GIS!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130407/6dd06f06/attachment.html>
More information about the Users
mailing list