开发者

OpenLayers Select Feature with control points

开发者 https://www.devze.com 2023-03-25 02:00 出处:网络
I have a OpenLayers.Layer.GML layer build with GeoJSON data given by MapFish. When I select his features control points are displayed and they let me edit the shape of the features. Well I don\'t want

I have a OpenLayers.Layer.GML layer build with GeoJSON data given by MapFish. When I select his features control points are displayed and they let me edit the shape of the features. Well I don't want them! And I don't know how they appeared or why. There must be some setting in the control, in the layer or in the map that produce this.

Here's a screenshot

OpenLayers Select Feature with control points

The code I use to generate the control is this:

_selectFeatureControl = new OpenLayers.Control.SelectFeature(
    _activeLayer,
    {
        clickout: true, 
        toggle: true,
        multiple: false, 
        hover: false,
        toggleKey: "ctrlKey", // ctrl key removes from selection
        multipleKey: "shiftKey" // shift key adds to selection
    }
 );

The layer generation code is:

layer = new OpenLayers.Layer.GML(
   displayName,
   url,
   {
       format: OpenLayers.Format.GeoJSON,
       isBaseLayer: false,
       visibility: true,

       styleMap: styleMap,

       projection: new OpenLayers.Pro开发者_运维技巧jection("EPSG:4326")
   }
);                       

Thanks every one!


try this:

var controls = map.getControlsByClass('OpenLayers.Control.ModifyFeature');
for(var i=0;i<controls.length;i++){
    controls[i].deactivate();
    controls[i].destroy();
}
0

精彩评论

暂无评论...
验证码 换一张
取 消