• Stars
    star
    340
  • Rank 124,317 (Top 3 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created almost 14 years ago
  • Updated about 11 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Framework to add convenience-stuff for easier coping with CoreLocation/MapKit on iOS. It includes a custom UIBarButtonItem mimicing the Locate-Me-Button of the built-in Google Maps App

Read Me

Currently Idle Currently searching for a location Currently receiving location updates Currently receiving heading updates

Description

These classes aim to mimic some of the functions of the built-in Google Maps App on iOS for you. Currently the library contains a simple Location Manager-Singleton that sends out notifications when CLLocationManager-Delegate-Methods are called and a UIBarButtonItem/UIButton that acts as a Locate-Me Button that behaves similar to the one in the Google Maps App. The switch from one mode to another is animated, just like in the Google Maps App.

It can also be customized to support Heading-Updates, by setting property headingEnabled.

Routes/Directions

If you want to display routes directly on top of MKMapView have a look at my new framework MTDirectionsKit: mtdirectionsk.it

Installation

Just copy over all .h and .m - Files to your project, as well as the image bundle included. You may exchange the images with your own, but make sure to adopt frames and sizes in the code, if your images have a different size than the one provided (only if there are any visual quirks).

Usage

Here's a minimal example of how to use MTLocation: https://gist.github.com/1373050

If you have problems getting the map-rotation to work, please refer to the following thread on StackOverflow: Rotating MapView

Update: MTLocation now provides the category-method [MKMapView sizeToFitTrackingModeFollowWithHeading] to automatically size the MapView.

You can use MTLocateMeBarButtonItem like this:

 // Configure Location Manager
 [MTLocationManager sharedInstance].locationManager.desiredAccuracy = kCLLocationAccuracyBest;
 [MTLocationManager sharedInstance].locationManager.distanceFilter = kCLDistanceFilterNone;
 [MTLocationManager sharedInstance].locationManager.headingFilter = 5; // 5 Degrees

 // Create MapView
 self.mapView = [[[MKMapView alloc] initWithFrame:CGRectZero] autorelease];
 [self.view addSubview:self.mapView];

 // create locate-me item, automatically prepare mapView
 self.locateMeItem = [UIBarButtonItem userTrackingBarButtonItemForMapView:self.mapView];
 // add target-action
 [self.locateMeItem addTarget:self action:@selector(myCustomSelector:) forControlEvents:UIControlEventTouchUpInside];
 // disable heading
 self.locateMeItem.headingEnabled = NO;
 
 // create array with ToolbarItems
 NSArray *toolbarItems = [NSArray arrayWithObject:self.locateMeItem];
 // set toolbar items
 [self.toolbar setItems:toolbarItems animated:NO];

More Repositories

1

MTStatusBarOverlay

A custom iOS status bar overlay seen in Apps like Reeder, Evernote and Google Mobile App
Objective-C
1,922
star
2

MTDActionSheet

A customizable popover-based UIActionSheet replacement for the iPhone & iPad
Objective-C
489
star
3

MTDirectionsKit

Show directions directly on top of MKMapView
Objective-C
199
star
4

MTDURLPreview

Delight your users with simple URL previews for your iOS app
Objective-C
122
star
5

MTZoomWindow

A UIWindow that can be used to zoom in a specific UIView and displays it fullscreen
Objective-C
119
star
6

MTDirectionsKitDemo

Demo App demonstrating the use of MTDirectionsKit (mtdirectionsk.it)
Objective-C
98
star
7

MTSlideViewController

Just another take on Facebook's and Path's sliding navigation concept for iPhone
Objective-C
55
star
8

PageScrollView

A generic View that mimics Apple's homescreen-paging that supports both iPhone & iPad and rotation
Objective-C
41
star
9

MTInfoPanel

A clone of TweetBot's Notifications
Objective-C
27
star
10

AppleScripts

Some useful standalone Applescripts
AppleScript
24
star
11

Less-2-Do

ASE 06 Projekt - iPhone Todo App
Objective-C
20
star
12

LaunchBar-Actions

Some useful Applescripts for use as a LaunchBar (Quicksilver with slightly modifications) - Action
16
star
13

MTDLazyProperty

ObjC runtime playground: implementing memoized lazy evaluating properties with blocks
Objective-C
16
star
14

iOSAppTemplate

App Template for iOS using iOSKit and FoundationKit
Objective-C
12
star
15

MTHTTPFetcher

A Git-Clone of Matt Gallaghers' HTTP, XML and JSON Fetcher using JSONKit
Objective-C
10
star
16

TBXML-Encoded

A Fork of the lightweight TBXML Parser that directly parses encoded XML
Objective-C
9
star
17

Ghost-Runner

Prototype of an GPS Tracking System for Android
Java
6
star
18

AQGridViewAnimationSample

There's an animation-error, when rotating. Logic error or Bug in AQGridView?
Objective-C
5
star
19

TU-SS11-PROGSPR-UE2-HASKELL

Haskell Project for Vienna University of Technology
Haskell
3
star
20

XML-Parser

A sample XML Parser written in PostScript for University
Python
3
star
21

TU-SS11-HCI-LASTFM-SAMPLE

Objective-C
1
star
22

TU-WS12-MSWP

Vienna University of Technology - Management of Software Projects Group 12
1
star
23

MNCLogging

Simple Objective-C logging
Objective-C
1
star
24

Commander

A simple example of using Event Sourcing (https://martinfowler.com/eaaDev/EventSourcing.html)
Swift
1
star