media/DSMapView

DSMapView

media
since v2.0

MapKit wrapper with a pin annotation, user location dot, and a rounded-corner container style matching the DS.

iOS 17+macOS 14+

Purpose

Location display on profile, delivery tracking, event detail, and store finder screens.

Props

PropTypeDefaultDescription
coordinatereqCLLocationCoordinate2Dโ€”Center coordinate.
spanMKCoordinateSpanMKCoordinateSpan(0.01, 0.01)Visible map region.
showPinBooltrueShows a pin at the coordinate.
pinLabelString?nilCallout label on the pin.
showUserLocationBoolfalseShows the blue user dot.
heightCGFloat200Map view height.

Examples

Event location card

Map embedded in an event detail screen.

swift
DSMapView(
    coordinate: event.location.coordinate,
    span: MKCoordinateSpan(latitudeDelta: 0.005, longitudeDelta: 0.005),
    pinLabel: event.venue,
    height: 180
)