我想绘制一条不超过2分的路径。在第二点,我希望路径完成。
任何人都可以帮助我如何在openlayers 2中实现此功能。
我尝试了这段代码,但是虽然很好地创建了行,但它会出错。
_singleLineControl = new OpenLayers.Control.DrawFeature(
_singleLineLayer,
OpenLayers.Handler.Path,
{
eventListeners: { "featureadded": drawingFinished },
callbacks: {
point: function (pointGeometry, lineGeometry) {
var numPoints = lineGeometry.getVertices().length;
if (numPoints == 3) {
this.drawFeature(lineGeometry);
}
}
}
});
viewer.addControl(_singleLineControl);
_singleLineControl.handler.single = true;
_singleLineControl.handler.freehand = false;
_singleLineControl.deactivate();
答案 0 :(得分:0)
使用Error Loading Stream: Could not connect to server
maxVertices