D
D
Dima2015-02-28 15:51:28
JavaScript
Dima, 2015-02-28 15:51:28

Yandex maps how to get all waypoints?

How to get all waypoints?
Not final and not transit, but in general everything. That is, the points of the bend of the route line (as the points of the polyline).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dima, 2015-02-28
@MAXOPKA

Understood.
Route -> Paths -> Segments -> Waypoints

var all_points=[];
                var paths=route.getPaths();
                var i=0;
                while(paths.get(i)!==null){
                    var p=paths.get(i);
                    var segments=p.getSegments();
                    $(segments).each(function(){
                        var pc=this.getCoordinates();
                        $(pc).each(function(){
                            all_points.push(this);
                        });
                    });
                    i++;
                }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question