MapKit Reference
API reference for MapKit: the SwiftUI Map and UIKit's MKMapView, annotations, overlays, search, directions, Look Around, snapshots, and geocoding.
When to Use This Reference
Use this reference when:
- Looking up the SwiftUI
Mapcontent builder API - Configuring
MapCameraPositionfor programmatic camera control - Implementing
MKLocalSearchorMKLocalSearchCompleter - Setting up
MKDirectionsfor routing - Working with Look Around scenes
- Converting between addresses and coordinates with the geocoding APIs
- Choosing between SwiftUI
MapandMKMapView, for example when you need annotation clustering
Example Prompts
Questions you can ask your assistant that will draw from this reference:
- "What's the SwiftUI
MapAPI for annotations?" - "How do I use
MapCameraPosition?" - "What's the
MKLocalSearchCompleterAPI for autocomplete?" - "How do I calculate directions between two points?"
- "Do I need
MKMapViewto cluster thousands of annotations?" - "How do I create a map snapshot image?"
- "How do I turn an address into coordinates with
MKGeocodingRequest?"
What's Covered
- SwiftUI vs.
MKMapViewfeature comparison - SwiftUI
MapAPI: content builder,MapCameraPosition, selection, camera change callbacks, styles, interaction modes - Map content:
Marker,Annotation,UserAnnotation, shape overlays MKMapViewin SwiftUI, clustering, and keyMKMapViewDelegatemethods- Annotation views:
MKMarkerAnnotationView,MKAnnotationView, custom callouts, reuse MKLocalSearchandMKLocalSearchCompleter, result types, rate limiting, and the 11 point-of-interest categories new in the 27 releasesMKDirectionsandMKRoute: transport types, ETA-only requests, turn-by-turn steps- Look Around:
MKLookAroundScene,LookAroundPreview, static snapshots - Overlays and renderers, overlay levels, gradient polylines
- Map snapshots with
MKMapSnapshotter - GeoToolbox and
PlaceDescriptor MKGeocodingRequest,MKReverseGeocodingRequest, andMKAddress- Choosing between geocoding and
MKLocalSearch
Documentation Scope
This page documents the mapkit-ref skill (in the axiom-location suite), the API reference your assistant uses for MapKit syntax and configuration.
Related
- MapKit – Decision trees and anti-patterns for building map features
- MapKit Diagnostics – Troubleshooting annotations, region jumping, and search failures
- Core Location Reference – The location APIs that feed a map
Resources
WWDC: 2023-10043, 2024-10094
Docs: /mapkit, /mapkit/map, /mapkit/mklocalsearch, /mapkit/mkdirections, /geotoolbox, /geotoolbox/placedescriptor, /mapkit/mkgeocodingrequest, /mapkit/mkreversegeocodingrequest, /mapkit/mkaddress