@Override
protected void updateTempLineAfterMove(MouseEvent<?> event) {
if (tempPolygon == null) {
updateTempLineAfterClick();
}
Polygon polygon = (Polygon) geometry;
if (polygon != null && polygon.getCoordinates() != null && polygon.getCoordinates().length > 0) {
LinearRing ring = geometry.getGeometryFactory().createLinearRing(polygon.getCoordinates());
if (ring != null && geometry.getCoordinates().length > 0) {
Coordinate[] coordinates = ring.getCoordinates();
Coordinate firstCoordinate = coordinates[0];
Coordinate lastCoordinate = coordinates[coordinates.length - 2];
LineString lineStringPan = geometry.getGeometryFactory().createLineString(new Coordinate[] {
getTransformer().worldToPan(lastCoordinate),
getPanPosition(event),
getTransformer().worldToPan(firstCoordinate) });
tempLine.setGeometry(lineStringPan);
mapWidget.render(tempLine, RenderGroup.VECTOR, RenderStatus.ALL);
}
}
}
PolygonDrawController.java 文件源码
java
阅读 23
收藏 0
点赞 0
评论 0
项目:geomajas-project-client-gwt
作者:
评论列表
文章目录