如何像在 osmdroid 中一样在 mapsforge 中设置边界框,以及如何在 pathLayer 上方或下方放置文本?
在 osmdroid 中,我通常调用该setScrollableAreaLimit()
方法,但在 mapsforge 中没有这样的方法mapView
。我该如何做到这一点?
还有我如何在TextOverlay
下面或上面添加一个PathLayer
?
//Bounding Box
maxScrollableLimit = new BoundingBox(14.7882,121.1421,14.3469,120.8990);
...
private PathLayer createPathLayerFirst(PathWrapper response) {
Style style = Style.builder()
.generalization(Style.GENERALIZATION_SMALL)
.strokeColor(0x9900cc33)
.strokeWidth(4 * getResources().getDisplayMetrics().density)
.build();
PathLayer pathLayer = new PathLayer(mapView.map(), style);
List<GeoPoint> geoPoints = new ArrayList<>();
PointList pointList = response.getPoints();
for (int i = 0; i < pointList.getSize(); i++)
geoPoints.add(new GeoPoint(pointList.getLatitude(i), pointList.getLongitude(i)));
pathLayer.setPoints(geoPoints);
return pathLayer;
}