TechnologiesMaps & Location

_MapKit_SwiftUI cross-import overlay

iOSmacOStvOSwatchOSvisionOS

This cross-import overlay brings MapKit into SwiftUI, letting you build declarative map views with customizable annotations and type-erased map content across iOS, macOS, tvOS, watchOS, and visionOS. You place content such as MapMarker, MapPin, MapAnnotation, MapCircle, MapPolygon, and MapPolyline, and control the viewport through MapCamera, MapCameraBounds, and MapCameraPosition. You configure presentation and behavior with MapStyle, MapInteractionModes, MapUserTrackingMode, and PointOfInterestCategories, and respond to selection and user position using MapSelection, MapFeature, MapProxy, and UserLocation.

Map Content 3

Protocols that define the content you place on a map and how it participates in selection.

  • Pr
    DynamicMapContentiOS 17.0+
    A type that produces map content dynamically from an underlying collection of data.
  • Pr
    MapAnnotationProtocoliOS 14.0+
    A type that represents a custom annotation placed at a coordinate on a map.
  • Pr
    MapSelectableiOS 17.0+
    Represents a selection of either a map feature, or map content with a given tag value.

Annotations and Overlays 6

Markers, pins, and shapes you add to a map to highlight places and regions.

  • St
    MapMarker
    A balloon-shaped marker that displays a title and icon at a coordinate on the map.
  • St
    MapPin
    A pin that marks a coordinate on the map.
  • St
    MapAnnotation
    An annotation that displays a custom SwiftUI view at a coordinate on the map.
  • St
    MapCircleiOS 17.0+
    A circular overlay with a configurable radius that you center on a geographic coordinate.
  • St
    MapPolygoniOS 17.0+
    A closed polygon overlay.
  • St
    MapPolylineiOS 17.0+
    An open polygon overlay consisting of one or more connected line segments.

Camera and Viewport 6

Types that describe and constrain the map's framing, position, and update behavior.

  • St
    MapCameraiOS 17.0+
    Defines a virtual viewpoint above the map surface.
  • St
    MapCameraBoundsiOS 17.0+
    Defines an optional boundary of an area within which the map’s center needs to
  • St
    MapCameraPositioniOS 17.0+
    How to position the map's camera within the map.
  • St
    MapCameraUpdateContextiOS 17.0+
    A structure that provides information about the map's camera during an update.
  • St
    MapCameraUpdateFrequencyiOS 17.0+
    A structure that specifies how often the map reports camera updates.
  • St
    MapProxyiOS 17.0+
    A proxy for accessing sizing information about a given map view.

Style and Interaction 5

Configuration values that control a map's appearance, allowed gestures, and points of interest.

  • St
    MapStyleiOS 17.0+
    A Style that can be applied to a Map.
  • St
    MapInteractionModesiOS 14.0+
    The ways a user can interact with a map.
  • En
    MapUserTrackingMode
    An enumeration of modes that control how a map follows the user's location and heading.
  • St
    PointOfInterestCategoriesiOS 17.0+
    Point of Interest categories to be shown.
  • St
    MapItemDetailSelectionAccessoryStyle
    The map item detail selection accessory style

Selection and User Position 3

Types for tracking the user's location and responding to selected map features.

  • St
    MapFeatureiOS 17.0+
    Represents a tappable map feature.
  • St
    MapSelectioniOS 18.0+
    Can represent a tag value or a `MapFeature`.
  • St
    UserLocationiOS 17.0+
    Information about the current location of the user.

Structures 17

  • St
    AnnotationiOS 17.0+
    A customizable annotation that marks a map location.
  • St
    AnyMapContentiOS 17.5+
    A type-erased map content.
  • St
    DefaultUserAnnotationContentiOS 17.0+
    You don't use this type directly. Instead MapKit creates this type on
  • St
    EmptyMapContentiOS 17.0+
    A piece of map content that doesn't contain any content.
  • St
    LookAroundPreview
  • St
    MapiOS 14.0+
  • St
    MapCompassiOS 17.0+
    A view that reflects the current orientation of the associated `Map`.
  • St
    MapContentBuilderiOS 17.0+
    A result builder that creates map content content from closures.
  • St
    MapContentViewiOS 17.0+
  • St
    MapPitchToggle
    A button that will set the asosciated pitch of the associated `Map` to a
  • St
    MapReaderiOS 17.0+
    A container view that defines its contents as a function of information about the first contained map.
  • St
    MapScaleView
    Displays a legend with distance information for the associated `Map`
  • St
    MapSelectableContentView
  • St
    MapUserLocationButtoniOS 17.0+
    A button that will set the framing of the associated `Map` to the User Location
  • St
    MarkeriOS 17.0+
    A balloon-shaped annotation that marks a map location.
  • St
    TupleMapContentiOS 17.0+
Show 1 more
  • St
    UserAnnotationiOS 17.0+
    Displays the current location of the user on the map.

Protocols 1

  • Pr
    MapContentiOS 17.0+

Extends 8

NeverForEachViewMKMapItemRequestGroupOptionalModifiedContentCLLocationCoordinate2D
← Maps & Location