Answer the question
In order to leave comments, you need to log in
Yandex maps API: how to get polyline coordinates on mousemove?
The path (polyline) is displayed on the map, there are other data for each pair of coordinates (speed, etc.). How can you get which part of the path the mouse is hovering over, an index or something else that will allow you to correlate with other data.
I would like something by analogy with Autoscan + (demo / demo) - point on the map to the path and see the mark on the chart.
The variant with the search for the nearest point is not suitable (the waypoints can be close).
Answer the question
In order to leave comments, you need to log in
I did: I
take the mouse coordinates (ev.get('coords')) and look for the nearest
UPD
point :
var mousePos = ev.get('coords');
var indexNearest = ev.originalEvent.target.geometry.getClosest(mousePos).closestPointIndex;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question