Ad

GPolyline Overlay In Android MapView

- 1 answer

I have a working mapview application in which I can hit a service and show GPoints on the map as overlay.

What I want to do next is show an encoded Gpolyline as an overlay on my mapView. When I try to instantiate a GPolyline polyline object in my main activity, eclipse doesn't recognize the class. Is there a library import I am missing?

A quick example of adding a GPolyline to the mapView in an android application would be a great help.

Ad

Answer

I think the problem you're having is that there aren't GPolyline's in Android's version of Google Maps, they're Javascript/AJAX specific. What you want to do is draw out the lines manually in an Overlay or OverlayItem. See this answer, for more details on specifically how to do this.

The Hello, MapView tutorial has a short example on drawing to an Overlay and the com.google.android.maps package docs should show you what's available in Android's version of Google Maps.

Ad
source: stackoverflow.com
Ad