Google Map Route Draw on IPhone

后端 未结 6 884
天涯浪人
天涯浪人 2020-12-07 15:09

I am developing an application that has two versions. One for web and another for iPhone.

In the web app, I am able to draw a route on the road (drawing the route a

6条回答
  •  无人及你
    2020-12-07 15:53

    A standard way on the iPhone (since there are restrictions expressed in the MapKit license) is to use [[[UIApplication sharedApplication] delegate] openURL:myURL]; to open up the Maps app.

    myURL is a 'http://maps.google.com/maps?...' URL (NSURL object) with the subset of options supported in the docs on developer.apple.com. You use the saddr= and daddr= parameters to set the start and end address (or coordinates) of the route, and the user can then see the route and use the Maps app's driving, biking, or walking text directions to travel the route. Perhaps on iPhone 4 GM you will be able to return to your program, but currently opening the URL will terminate your app and start the Maps (or Safari, if Maps is not installed) app instead.

提交回复
热议问题