我正在尝试在google map上绘制行程路径的折线,该折线在Android OS 8.0及更高版本上完美运行,但在5.0、6.0、7.0上却无法绘制。
在下面提到了我如何绘制它的实现 @Override
public void onMapReady(GoogleMap googleMap) {
// Add polylines and polygons to the map. This section shows just
// a single polyline. Read the rest of the tutorial to learn more.
Polyline polyline1 = googleMap.addPolyline(new PolylineOptions()
.clickable(true)
.add(
new LatLng(-35.016, 143.321),
new LatLng(-34.747, 145.592),
new LatLng(-34.364, 147.891),
new LatLng(-33.501, 150.217),
new LatLng(-32.306, 149.248),
new LatLng(-32.491, 147.309)));
// Position the map's camera near Alice Springs in the center of Australia,
// and set the zoom factor so most of Australia shows on the screen.
googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(-23.684, 133.903), 4));
}
请提出错误或需要修改的地方,我正在使用与Google文档完全相同的实现方式。
谢谢。