Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting routes and turn-by-turn navigation in an iPhone app

I'm developing an app that will focus heavily on giving users routes and turn-by-turn directions while driving. It is important that they stay within the app during their drive, so I really don't want to make them leave the app and go to the built-in Maps app. I have been doing a lot of research lately on how to include this functionality, and it is widely known that it is not easy, since Apple doesn't include this functionality in the SDK out of the box. It looks like my options are:

For providing routes (and directions) from one place to another

  • Use a UIWebView and load some web-based maps with JavaScript, and use the JavaScript API to draw a route
  • Use MapKit or the Google Maps iOS SDK, query for the route sepaartely through an API, and manually draw some kind of path or polyline on top of it.
  • Use a library that costs money (like MTDirectionsKit)

For providing turn-by-turn navigation

  • Use a proprietary library that comes with its own maps (like CloudMade)

Is there anything I'm missing here? What are the pros and cons of each, and how should I pick a solution?

Your insight is greatly appreciated. Thanks!

like image 748
Andrew Avatar asked May 15 '13 01:05

Andrew


People also ask

Does iPhone Maps have a route planner?

Does Apple Maps have a Route Planner? Yes, Apple Maps does have this feature. The route is optimized to move from your starting point to the next location. It can plan a path between two stops.


3 Answers

You say that you don't want to "make" the user leave the app and use the built in software for turn by turn navigation as though this is a bad user experience. A bad user experience would be getting forced to use a turn by turn nav from a webView or some API which would not show up as routing information on my lock screen if I lock the phone or cut into other applications to display banners telling me a turn is coming up, for example, while I'm listening to music on my phone. I strongly suggest you launch Apple maps and let the system handle what it is meant to handle instead of trying to build your own turn by turn navigation and heavily limiting the user from the freedom of exiting the application during a drive.

like image 65
Kris Gellci Avatar answered Oct 06 '22 00:10

Kris Gellci


While on the subject of commercial libraries you might what to take a look at other options:

  • skobbler/telenav sdk - in-app routing and turn-by-turn navigation based on OpenStreetMap (same maps used by Cloudmade and Mapquest). Check out the demos and the licensing plans and figure out if it's the correct solution for you

(they have a Free Tier that might be good enough for your app - and if you go above that tier I think you should be considering monetizing you app)

  • and that's about it for the time being (besides the options already named): keep an eye out for Mapbox as they could provide an iOS sdk in the near future - with routing and navigation
like image 21
Ando Avatar answered Oct 06 '22 01:10

Ando


I agree with Kris' response. Turn-by-turn navigation is probably best handled by the built-in app. However, for displaying a route and ETA on a 2D map, I think I'm going to go with the Mapquest iOS API, which offers this functionality for free. I didn't know this solution was available until today.

like image 39
Andrew Avatar answered Oct 06 '22 00:10

Andrew