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,639
  • 5
  • 27
  • 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
  • 170,431
  • 36
  • 387
  • 313
1

Vladimir is right.See another sample code here

Drawing routes on mapkit

Rahul Vyas
  • 28,260
  • 49
  • 182
  • 256
0

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

Johan Kool
  • 15,637
  • 8
  • 64
  • 81