Skip to content
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
Find file
Pull request Compare This branch is 79 commits behind myell0w:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
MTLocation.xcodeproj
Resources
.gitignore
LICENSE
MKAnnotationView+MTLocation.h
MKAnnotationView+MTLocation.m
MKMapView+MTLocation.h
MKMapView+MTLocation.m
MTLocateMeBarButtonItem.h
MTLocateMeBarButtonItem.m
MTLocateMeBarButtonItem_Prefix.pch
MTLocateMeButton.h
MTLocateMeButton.m
MTLocation.h
MTLocationDefines.h
MTLocationFunctions.h
MTLocationFunctions.m
MTLocationManager.h
MTLocationManager.m
MTTouchesMovedGestureRecognizer.h
MTTouchesMovedGestureRecognizer.m
Readme.mdown

Readme.mdown

Read Me

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

Attention!

The repository MTLocateMeBarButtonItem was renamed to MTLocation because it already contains more than "only" the initial LocateMe-BarButtonItem and my plans are to add more features in the future. Be sure to update the URLs of your local clones, check out the section Changing a remote’s URL of

Help.GitHub - Working with remotes

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 or not, by setting property headingEnabled.

Installation

Just copy over all .h and .m - Files to your project, as well as the images 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

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 locate-me item
 MTLocateMeBarButtonItem *locateMeItem = [[[MTLocateMeBarButtonItem alloc] initWithLocationStatus:MTLocationStatusIdle] autorelease];
 // set delegate that is called when mode of Button changes
 locateMeItem.delegate = [MTLocationManager sharedInstance];
 // add target-action
 [locateMeItem addTarget:self action:@selector(myCustomSelector:) forControlEvents:UIControlEventTouchUpInside];
 // disable heading
 locateMeItem.headingEnabled = NO;

 // create array with ToolbarItems
 NSArray *toolbarItems = [NSArray arrayWithObject:locateMeItem];
 // set toolbar items
 [self.toolbar setItems:toolbarItems animated:NO];
Something went wrong with that request. Please try again.