R
R
Roman Prokopiev2018-05-16 20:40:49
Android
Roman Prokopiev, 2018-05-16 20:40:49

How to draw the passed route in google maps api (android)?

Hello, I have a question: how to build a route traveled from a set of coordinates (latitude and longitude)? Please let me know which one can be used.
PS I tried "Google-Directions-Android" lib and didn't find a way to draw the route there. (mb I'm just missing something)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri, 2018-05-17
@romik74

PolylineOptions rectOptions = new PolylineOptions()
.add(new LatLng(37.35, -122.0)) // add points
.add(new LatLng(37.45, -122.0))
.add(new LatLng(37.45, -122.2))
.add( new LatLng(37.35, -122.2))
.add(new LatLng(37.35, -122.0));
Polyline polyline = myMap.addPolyline(rectOptions);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question