This is a collection of MapKit samples for SwiftUI available for iOS 17.0 and later.
Can be built with Xcode 15.0 or later If you want to try UserAnnotation, please allow location permissions
- MapStyle Sample
With mapStyle, you can easily display everything from flat images to realistic 3D representations.
- Annotation Sample
Sample that can display customized annotations at any position
- MapCircle Sample
Sample of displaying an arbitrary position on a map with a circle over it
- MapPolygon Sample
Sample of displaying an arbitrary position on a map covered with a polygon
- MapPolyline Sample
Sample of displaying a linear line over an arbitrary location on a map
Toggle "View with routes" to display various routes.
| simple | routes |
|---|---|
![]() |
![]() |
- Marker Sample
Sample displaying a customized marker at an arbitrary location on a map
- UserAnnotation Sample
Sample to display your current position
Tapping the MapUserLocationButton displays your location, but this only works in Preview and on the actual device.
- MapControls Sample
Sample to display a multifunctional button easily with mapControls
- LookAroundPreview Sample
Sample to display any location in LookAroundPreview
You can toggle between viewing only the preview and viewing from the map.
- MapFeature Sample
Sample of large text displayed when tapping the notation on the map using mapFeatureSelectionContent
- MapCamera Sample
Sample of MapCamera and userLocation to instantly display the current location
To display the current location, it only works in Preview or on the actual device.
The simulator displays the fallback position.
- MapReader Sample
Sample of tapping on the map to get the longitude and latitude of the tap
- LocalSearch Sample
In this sample, enter the characters you want to search in the TextField and tap the "magnifyingglass" to display the search result marker on the map. Tap the marker to display detailed information in the safe area (bottom).









