protected void updateTempLines(FeatureTransaction featureTransaction, MouseEvent<?> event) {
if (featureTransaction.getNewFeatures() != null && featureTransaction.getNewFeatures().length > 0) {
if (tempLine1 == null) {
createTempLines(featureTransaction, event);
}
Polygon polygon = (Polygon) getGeometryIndex().getGeometry(featureTransaction);
LinearRing ring = getGeometryIndex().getLinearRing(polygon);
if (ring != null) {
Coordinate[] coordinates = ring.getCoordinates();
if (coordinates != null && coordinates.length > 0) {
Coordinate lastCoordinate = coordinates[coordinates.length - 2];
LineString lineString1 = featureTransaction.getNewFeatures()[index.getFeatureIndex()].getGeometry()
.getGeometryFactory().createLineString(
new Coordinate[] {getTransformer().worldToPan(lastCoordinate),
getPanPosition(event)});
tempLine1.setGeometry(lineString1);
mapWidget.render(tempLine1, RenderGroup.VECTOR, RenderStatus.ALL);
LineString lineString2 = featureTransaction.getNewFeatures()[index.getFeatureIndex()].getGeometry()
.getGeometryFactory().createLineString(
new Coordinate[] {getTransformer().worldToPan(coordinates[0]),
getPanPosition(event)});
tempLine2.setGeometry(lineString2);
mapWidget.render(tempLine2, RenderGroup.VECTOR, RenderStatus.ALL);
}
}
}
}
PolygonEditController.java 文件源码
java
阅读 21
收藏 0
点赞 0
评论 0
项目:geomajas-project-client-gwt
作者:
评论列表
文章目录