pinTintColor
for custom pin color
"popup" when tapping on pin
New detailCalloutAccessoryView
for support auto-layout or stackview as complex layout inside of callout
mapView.showsTraffic
to show traffic
mapView.showsScale
to show scale
mapView.showsCompress
to show compress
CLGeocoder
MKLocalSearch
MKDirectionsTransportType
for selecting transport type
New transport type : Transit
//retrieving ETA to a POI
func getTransitETA(){
let request = MKDirectionsRequest()
/* Set Source */
/* Set Destination */
//Set Transport Type to be Transit
request.transportType = MKDirectionsTransportType.Transit
let directions = MKDirections(request: request)
directions.calculateETAWithCompletionHandler { response, error in
// Handle Response
}
}
//opening native maps for getting transit guides
func openInMapsTransit(coord:CLLocationCoordinate2D) {
var placemark = MKPlacemark(coordinate:coord, addressDictionary: nil)
var mapItem = MKMapItem(placemark: placemark)
let launchOptions = [MKLaunchOptionsDirectionsModeKey:MKLaunchOptionsDirectionsModeTransit]
mapItem.openInMapsWithLaunchOptions(launchOptions)
}
New Map Type: .SatelliteFlyover , .HybridFlyover
MKMapCamera
Related session: WWDC 2013 Putting MapKit in Perspective
New camera init for flyover
init(lookingAtCenterCoordinate centerCoordinate: CLLocationCoordinate2D,
fromDistance distance:
CLLocationDistance,
pitch: CGFloat,
heading: CLLocationDirection)
Use overlays to highlight areas of the map