0

I want to draw path from one location to other location. How to plot the path between two location.

I have coordinates(latitude,longitude) for both location.

How can i achieve this functionality?

Thanks,
Jim.

Jim
  • 4,499
  • 5
  • 26
  • 31
  • Check out this question on SO: "How do i open Google Maps for directions using coordinates on the iphone" which explains how to use the Maps URL scheme to plot a direction between two points. http://stackoverflow.com/questions/1548024/ – Adrian Kosmaczewski Jan 12 '10 at 07:45
  • There is also this question on drawing routes on the map: http://stackoverflow.com/questions/1085749/google-map-route-draw-on-iphone – Brad Larson Jan 12 '10 at 15:26

3 Answers3

2

You can use google maps API to obtain path elements of the route and then draw them over the map. Also there's a MapKit extension by Kishikawa Katsumi available for download on github that provides this functionality.

Vladimir
  • 169,112
  • 36
  • 383
  • 312
1

Vladimir is right.See another sample code here

Drawing routes on mapkit

Rahul Vyas
  • 27,474
  • 48
  • 179
  • 252
0

- (CGPoint)convertCoordinate:(CLLocationCoordinate2D)coordinate toPointToView:(UIView *)view, CGContextMoveToPoint and CGContextAddLineToPoint should get you started.

Johan Kool
  • 15,389
  • 8
  • 61
  • 80