A
A
Alexander Vasilenko2016-01-12 13:12:54
Android
Alexander Vasilenko, 2016-01-12 13:12:54

What is the best way to implement a route in GoogleMaps as points?

Hello, friends.
I need to do the following thing - draw a route with dots on the Google map. I understand that the standard API does not provide such an opportunity, but suggests using Polyline. That's why I decided to implement a fairly hacky solution:
- create an array of markers
- attach a picture of a point to each marker
I will say right away that Circle is not suitable, I need the size of the points not to change. It is also necessary that the number of points change when scaling, so that the points do not intersect at a large scale, and are not too far apart from each other at a small one. I have not yet decided how to do this, but I will gladly accept advice))) But for now, I think that, depending on the scale, the iteration step over the elements of the array of all "points" will simply change when "drawing" elements on the map.
By the way, an object moves along the route, when it reaches a point, the image of the point changes to the image of the object, well, just in case.
What do you say, comrades? Maybe there is a more elegant solution? Some kind of specific library or something like that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Peter, 2016-01-12
@petermzg

So after all, you can style Polyline, here is an example from the documentation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question