0
votes

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.

1
There are lot of help in this question. stackoverflow.com/questions/10598322/… - Damitha Raveendra
I already saw this link.But my two points may change each time.So how to change it in route.csv? - Madhumitha

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....:)