//画图形返回圖形的范围
var polygonLayer = new OpenLayers.Layer.Vector("选择范围");
var drawControls = new OpenLayers.Control.DrawFeature(polygonLayer,OpenLayers.Handler.Polygon,
{
featureAdded:function(){
drawControls.deactivate();
var a = new OpenLayers.Format.WKT().write(polygonLayer.features);
GetPdata =a.substring(a.indexOf("(")+1, a.indexOf(")")+2);
drawToreturn();
}
});
map.addLayers([polygonLayer]);
drawPolygon = function(){
polygonLayer.removeAllFeatures();
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new OpenLayers.Control.MousePosition());
map.addControl(drawControls);
drawControls.activate();
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-06
  • 2021-11-26
  • 2022-01-24
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-31
  • 2022-01-11
  • 2022-01-31
  • 2022-12-23
  • 2021-07-20
  • 2022-12-23
相关资源
相似解决方案