我无法从地图中删除editingToolBar。我不明白为什么这段代码不起作用:
var editingToolBar = new OpenLayers.Control.Panel({
displayClass: 'customEditingToolbar',
allowDepress: true
});
var draw = new OpenLayers.Control.DrawFeature(
newShape, OpenLayers.Handler.Polygon,
{
title: "Draw Feature",
displayClass: "olControlDrawFeaturePolygon",
multi: true
}
);
var edit = new OpenLayers.Control.ModifyFeature(newShape, {
title: "Modify Feature",
displayClass: "olControlModifyFeature"
});
editingToolBar.addControls([edit, draw]);
map.addControl(editingToolBar);
function stopEditing(){
map.removeControl(editingToolBar);
}
感谢调试!