I am trying to figure out a way to get all the latitude and longitude points from a MKPolyline drawn on a MKMapView on an iOS app.
I know the MKPolyline does not store latitude and longitude points, but I am looking for a way to build an array of lat and long the MKPolyline would touch on the map.
Anybody has specific possible solutions on this?
Thank you
EDIT: After seeing the first response (thank you) I think I need to explain better what my code is doing:
- first I call "calculateDirectionsWithCompletionHandler" on a MKDirections object
- I get back MKRoute object which has a "polyline" property.
- then I call "addOverlay" on the mapview passing in the polyline from the MKRoute object
That's all.
So, I already have a polyline built for me. So I would like to get all the points found in the polyline somehow and map them to a lat and long...