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.
Asked
Active
Viewed 2,423 times
0
-
There are lot of help in this question. http://stackoverflow.com/questions/10598322/iphone-how-to-draw-line-between-two-points-on-mapkit – Damitha Raveendra Jun 06 '12 at 05:58
-
I already saw this link.But my two points may change each time.So how to change it in route.csv? – Madhumitha Jun 06 '12 at 06:05
-
[Stack Overflow is not your personal research assistant](http://meta.stackexchange.com/a/128553/185112). – Sean Mickey Jun 06 '12 at 12:47
1 Answers
1
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....:)

Community
- 1
- 1

The iCoder
- 1,414
- 3
- 19
- 39