Key Concepts: MapKit/CL GeoCoder
MapKit is a powerful mapping framework that makes it easy to provide user friendly and accurate mapping visuals to users.
- CLLocationCoordinate2D: a struct that contains longitude and latitude values. Create them with CLLocationCoordinate2DMake()
- MKCoordinateSpan: a struct that defines an area on the world's surface. Create one with MKCoordinateSpanMake. The units are in degrees.
- MKCoordinateRegion: a struct that contains a center coordinate and a span, thus defining a region on a map. Create one with MKCoordinateRegionMake.
- MKMapView is a class that shows a map.
- CLGeocoder is a class that allows you to convert an address string (eg "223 W Erie, Chicago") to a coordinate that can be consumed by MapKit.
MKMapView has a region property that you can set to focus the map on the area your app cares about.
Engage the showsUserLocation property to show the user location on your MKMapView.
You can add pins to your map by creating MKPointAnnotations, setting their coordinate, and using the addAnnotation: method on your MKMapView.
You can customize pins by implementing the MKMapViewDelegate protocol and implementing mapView:viewForAnnotation.
MKAnnotations are represented by MKAnnotationViews on the mapView. Like NSStrings are represented by UILabels or UITextViews.