Playing around with the new API today to see if I can port my current app to it, I see that there is no MapView.getOverlays().add(...);
Conceptually, it seems hard to imagine how an overlay which was previously 2D, would be rearranged when the map is tilted.
I see that there is functionality for something called GroundOverlay
but this does not look applicable to my case. I also see Polyline
and this looks better suited to my purpose.
Does anyone have any idea on how, or if one will be able to add a route overlay (I'm using the Directions API) using the mapping API v2?
It's done with Polyline
. From the example on the Google Developers page - 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));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With