Skip to content

MapKit, the Missing Part — Dance before Sherlocking comes

Notifications You must be signed in to change notification settings

iridia/IRGeoHelper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IRGeoHelper

MapKit callbacks made easy. p.s. GOOD JOB MAPKIT TEAM, THE NEW MAP IS AWESOME!!

Sample

Look at the Sample App. It has a map view and three buttons.

What’s Inside

There’s an IRMapView, again a drop-in replacement for MKMapView. You can now do this (all code copied from the sample app):

[self.mapView setRegion:region animated:YES completion:^{

	[[[UIAlertView alloc] initWithTitle:@"Changed Region" message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show];
	
}];

Not satisfied? How about this:

[self.mapView setCenterCoordinate:coordinate animated:YES completion:^{

	[[[UIAlertView alloc] initWithTitle:@"Changed Center Coordinate" message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show];
	
}];

Or this:

[self.mapView setVisibleMapRect:MKMapRectWorld edgePadding:UIEdgeInsetsZero animated:YES completion:^{

	[[[UIAlertView alloc] initWithTitle:@"Changed Map Rect" message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show];
	
}];

Yes, you can nest them. And, also yes, if you invoke these methods when the user is scrolling, IRMapView is polite enough to animate only after the user has finished scrolling. If you would rather not do anything, you can observe the (currently private) changingRegion property on the map view, which is a BOOL. It participates in KVO.

Licensing

This project is in the public domain. You can use it and embed it in whatever application you sell, and you can use it for evil. However, it is appreciated if you provide attribution, by linking to the project page (https://github.com/iridia/IRGeoHelper) from your application.

Credits

About

MapKit, the Missing Part — Dance before Sherlocking comes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published