mapbox / mapbox/mapbox-maps-swiftui-demo
How to get the location on the map by tapping?
- Dominant language
- Swift
- Stars
- 29
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I know I can add tapgesture recognizer to the mapview, but how do I get the coordinates of my tap?
`MapView(centerCoordinate: $centerCoordinate, selectedPlace: $selectedPlace, showingPlaceDetails: $showingPlaceDetails, annotations: annotations).zoomLevel(1.8).gesture(
TapGesture()
.onEnded { print("tapped")
})`
Contributor guide
Research direction
Start from the MapView and TapGesture snippet in the issue and inspect the repository's map interaction entry points. Determine whether the tap callback exposes map coordinates and define a reproducible example or documentation of the supported approach; done when the coordinate can be obtained from a map tap.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100