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
  • 2,391
  • 4
  • 27
  • 47
Madhumitha
  • 3,794
  • 8
  • 30
  • 45

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,414
  • 3
  • 19
  • 39