0

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.

Farshid Shekari
  • 1,941
  • 4
  • 23
  • 45
Madhumitha
  • 3,734
  • 8
  • 28
  • 42

1 Answers1

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,396
  • 3
  • 18
  • 39