Pergunta

I'm working in an Android application that will use Google directions service.

The source location is determined by the GPS and the destination is set by the user, the user can also set some waypoints by touching in the MapView (this is optional). Finally the app draws the route between these points.

When invoking the Google directions service I get a list of "steps", as far as I'm concerned each step corresponds to a point where the driver has to turn (right?). Is it posible to get more steps? For example consider each corner of the path as a step?

Thanks in advance.

Foi útil?

Solução

Finally I could draw a precise route by decoding the "polyline" of each step returned by the service. A polyline contains an object holding an array of encoded points that represents an approximate path.

So I decoded that into a List of GeoPoints and then drew the lines between those GeoPoints.

In case someone needs to do something similar, this was really useful to me:

Google Maps API Version difference

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top