Returns the geographic coordinate and cumulative progress values at the point on a route
nearest to the given location.
Projects point onto the route line using nearestPointOnLine, then linearly interpolates
the progress data at the snapped position between the two bracketing route vertices.
the progress data is incomplete for the snapped position
Example
constresult = getProgressAtNearestRoutePoint(route, { lng:4.92, lat:52.32 }); if (result) { console.log(`Nearest point: [${result.position}]`); console.log(`${result.distanceInMeters} m from route start`); console.log(`${result.travelTimeInSeconds} s travel time from route start`); }
Returns the geographic coordinate and cumulative progress values at the point on a route nearest to the given location.
Projects
pointonto the route line usingnearestPointOnLine, then linearly interpolates the progress data at the snapped position between the two bracketing route vertices.