I am having two coordinate points on Google map. I calculated the distance between that points. But I want to draw a straight line between them. Please help me to draw.
0
votes
1 Answers
1
votes
You have to use google direction api for that follow the Direction API Link .
Make request using NSURLConnection with direction api url and pass required addresses from it it and catch its response.
From that you will get json or xml formatted response, which contains paths in the form of polyline encoded string .
Then parse it and retrieve polyline encoded string.
- You have to simply decode it it then you will get all points of your path and pass it to viewForOverlay method of MKMapViewDelegate which will draw the path.
- For more information follow my question Stackoveflow question link .
If you have any more quires let me know. Hope this will help you....:)