mapbox / mapbox/mapbox-maps-swiftui-demo

How to get the location on the map by tapping?

Open
#8 0 comments 1 reaction 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.