今天玩弄新的 API 看看我是否可以将我当前的应用程序移植到它,我发现没有MapView.getOverlays().add(...);
。从概念上讲,似乎很难想象当地图倾斜时,以前的 2D 叠加层会如何重新排列。
我看到有一些叫做的功能,GroundOverlay
但这看起来不适用于我的情况。我也看到Polyline
了,这看起来更适合我的目的。
有没有人知道如何使用映射 API v2 添加路线覆盖(我使用的是 Directions API),或者是否能够添加路线覆盖?
今天玩弄新的 API 看看我是否可以将我当前的应用程序移植到它,我发现没有MapView.getOverlays().add(...);
。从概念上讲,似乎很难想象当地图倾斜时,以前的 2D 叠加层会如何重新排列。
我看到有一些叫做的功能,GroundOverlay
但这看起来不适用于我的情况。我也看到Polyline
了,这看起来更适合我的目的。
有没有人知道如何使用映射 API v2 添加路线覆盖(我使用的是 Directions API),或者是否能够添加路线覆盖?
它已经完成了Polyline
。来自 Google Developers 页面上的示例 - https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/model/Polyline
GoogleMap map;
// ... get a map.
// Add a thin red line from London to New York.
Polyline line = map.addPolyline(new PolylineOptions()
.add(new LatLng(51.5, -0.1), new LatLng(40.7, -74.0))
.width(5)
.color(Color.RED));