public static Path2D convertPolylineToPath(final IMapObject mapObject) {
if (mapObject == null || mapObject.getPolyline() == null || mapObject.getPolyline().getPoints().isEmpty()) {
return null;
}
Path2D path = new Path2D.Float();
path.moveTo(mapObject.getLocation().getX(), mapObject.getLocation().getY());
for (int i = 1; i < mapObject.getPolyline().getPoints().size(); i++) {
Point2D point = mapObject.getPolyline().getPoints().get(i);
path.lineTo(mapObject.getLocation().getX() + point.getX(), mapObject.getLocation().getY() + point.getY());
}
return path;
}
MapUtilities.java 文件源码
java
阅读 26
收藏 0
点赞 0
评论 0
项目:litiengine
作者:
评论列表
文章目录