Important facts about commercial licenses

  • Licenses are perpetual. They do not expire and do not need to be renewed.
  • Licenses can be upgraded. You can upgrade to a more expensive license later paying only the difference in cost.
  • Pay attention to the distribution type - Hosted (sites / servers), binary (applications) or source (includes all the others). Choose according to your needs (more below).
  • All licenses allow commercial use unless otherwise indicated.
  • Read the full license by clicking on the icon.
  • Read more about licenses in our handy license guide.
$499

Developer License

Unlimited projects Source and binary distribution
You need to log-in or create an account
  • Create an account
  • Log-in
  • Please use your real name.
  • Account activation link will be sent to this address.
  • Minimum 8 characters

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

MTDirectionsKit

MTDirectionsKit
Developed by Matthias Tretter, Released Jun 6, 2012

Let your iOS App guide you wherever you want and show directions directly on top of MKMapView.

Objective-C

Tags: directions , mapkit , maps , route

Why MTDirectionsKit?

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)

Demo and 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 a sample call:

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.

Independent of which way to integrate MTDirectionsKit you choose, 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, see pictures below).

Integrating Binary Framework

Just drag MTDirectionsKit.framework onto the Frameworks-group of your App, add

#import <MTDirectionsKit/MTDirectionsKit.h>

everywhere you want to use it and you are good to go.

![MTDirectionsKit.framework](http://f.cl.ly/items/3x0F1L400f3r1T142p14/MTDirectionsKit_Framework.png "Binary Framework")

Integrating MTDirectionsKit.xcodeproj (Dependency)

First copy the whole MTDirectionsKit project into your applications root folder and use this project for the following steps:

  1. Locate the "MTDirectionsKit.xcodeproj" file inside your applications root folder and drag it onto the root of your Xcode project's Frameworks-group
  2. Add MTDirectionsKit as target dependency of your target under the tab Build Phases
  3. Drag libMTDirectionsKit.a onto the section 'Link Binary with Libraries' of your target

You are good to go, just

#import <MTDirectionsKit/MTDirectionsKit.h>

everywhere where you want to use it.

![MTDirectionsKit.xcodeproj as Dependency](http://f.cl.ly/items/3D40042w200D0a3u0h0R/MTDirectionsKit_Dependency.png "Dependency")

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.

User Reviews

No reviews have been submitted yet.
Read all 2 comments »

Questions & Comments


Or enter your name and Email
  • Kleber Felipe 4 months ago
    Hello, Im from Brazil. Do you see this not working here due to location or it should work just fine?
    I noticed the sample apps lists cities in Brazil with the Z, I was wonrdering if it would be possible to change it to Brasil since this is how we spell it here.
    Thx
    • Matthias Tretter Developer 4 months ago
      I'm afraid I don't fully know what you mean. Which sample apps are you referring to?
You must be logged-in to vote. Log-in to your account or register now.