App Source Code for Sale

Author

myell0w

iOS > Utilities > GeoLoc & Maps

MTDirectionsKit

Overview

Did you ever wonder why Apple didn't provide a way to show directions directly on top of MKMapView and force you to switch to their built-in Maps.app just to guide your users somewhere? We too, that's why we built MTDirectionsKit. Switching to Maps.app just to show directions results in a context-switch and can confuse your users, thus increasing the chance that they won't return to your Application.

MTDirectionsKit is a full-featured and easy to use solution to show directions in your App, directly on top of MKMapView. Not only will your users thank you for not throwing them out of your App, it will also distinguish your App from all the others that don't offer this functionality.

Convinced? Let's get you started.

MTDirectionsKit can use the following three APIs for gathering routing information:

  1. MapQuest Open Directions API
  2. Google Directions API
  3. [Bing Routes API] (http://msdn.microsoft.com/en-us/library/ff701705.aspx "Bing Routes API")

Demo & Documentation

You can find a demo application here: MTDirectionsKit Demo

Full documentation is available here: MTDirectionsKit Documentation

How to use?

MTDirectionsKit is very easy to use, here's sample code:

MTDMapView *_mapView = [[MTDMapView alloc] initWithFrame:self.view.bounds];

// ...
// setup _mapView
// ...

// configure MTDirectionsKit (optional)
// log more messages
MTDDirectionsSetLogLevel(MTDLogLevelInfo);
// change used API to Google Directions
MTDDirectionsSetActiveAPI(MTDDirectionsAPIGoogle);
// manually change measurement system 
// Warning: MTDirectionsKit automatically sets it to the preferred one of the user's device,
// only override if you have a really good reason to
MTDDirectionsSetMeasurementSystem(MTDMeasurementSystemMetric);

// set the delegate of MKMapView. This automatically sets the directionsDelegate, if self
// conforms to the protocol MTDDirectionsDelegate
_mapView.delegate = self;

[_mapView loadDirectionsFrom:CLLocationCoordinate2DMake(51.38713, -1.0316)
                          to:CLLocationCoordinate2DMake(51.4554, -0.9742)
                   routeType:MTDDirectionsRouteTypeFastestDriving
        zoomToShowDirections:YES];

To see a detailed example on how to use MTDirectionsKit have a look at the provided Demo Application.

Integration

There are two ways to integrate MTDirectionsKit into your App:

  1. Include the binary framework MTDirectionsKit.framework
  2. Add MTDirectionsKit.xcodeproj as a dependency

The easiest way to integrate MTDirectionsKit is to add the binary framework to your App. For this just drag MTDirectionsKit.framework onto the Frameworks-group of your App and add

#import <MTDirectionsKit/MTDirectionsKit.h>

Everywhere you want to use it. Additionally you have to add some system frameworks and libraries to your project. For MTDirectionsKit to work you have to add

CoreLocation.framework
MapKit.framework
libxml2.dylib

to your target's linked libraries (found under Build Phases).

Requirements

MTDirectionsKit needs Xcode ≥ 4.5, iOS Base SDK ≥ 5.1 and Clang LLVM >= 3.1 to compile. It doesn't work with the old LLVM GCC compiler.

MTDirectionsKit works on a deployment target of ≥ iOS 4.3 and can be used in ARC or non-ARC applications.

Multiple App License $699.00
Download
0 comment Do you like this product? Have any Questions? Post a Comment. Leave a comment

More iOS item

Hotel App Template
$24.99
4.85 (36 votes)
by Chupa Team
Database Storage SQLite
FREE
4.18 (32 votes)
by Chupa Team
Color Shapes Rush - Unbelivable Price
$66.00
5.00 (2 votes)
by llcdraco