使用 Mapzen Android sdk,我使用方法在地图上使用纬度和经度绘制了两点之间的路线mapData.addPolyline(markers, props);
。
现在我想在这两点之间缩放地图。
缩放到单点可以通过以下方法完成:
public void goToLandmark(Landmark landmark) {
if (map == null) {
return;
}
int duration = 2000; // Milliseconds
// We use the position, zoom, tilt, and rotation of the Landmark to move the camera over time.
// Different types of "easing" are available to make the transition smoother or sharper.
map.setPositionEased(landmark.position, duration, MapController.EaseType.CUBIC);
map.setZoomEased(landmark.zoom, duration, MapController.EaseType.LINEAR);
map.setTiltEased(landmark.tilt, duration, MapController.EaseType.CUBIC);
map.setRotationEased(landmark.rotation, duration, MapController.EaseType.CUBIC);
}
请指导我,提前谢谢。