I am working on a project using MapKit where i need to find that either a given CLLocationCoordinate2D falls on a MKroute or not ?
I tried getting all the coordinates of the route using getCoordinates() method to check each one's distance with the given coordinate but this doesn't work since the method doesn't provide all coordinates.
Please suggest some approach, it doesn't need to be optimal. It should just solve the problem.
Till now the best solution i found is to check the distance of the given coordinate with each line segment.
By using route.polyline.getCoordinates() method, We already have an array of coordinates that makes the route.
Now all we have to do is -