Replies: 1 comment 1 reply
-
Hi @uzun0ff its all in the documentation but as an outline: const _mapRef = useRef()
const onMapPress = ({ geometry: { coordinates } }) => {
// do something with the coordintates
}
<Mapbox.MapView
ref={_mapRef}
onPress={onMapPress}
> You could also track a users touch point on screen and then get the translated coordinates from the map with const coordinate = await _map.getCoordinateFromView([touchPointX, touchPointY]); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to disable the map's movements and track where the user's finger is on the map.
For example the user presses a button that stops the map's movement and places a pin on the position he tapped or the user drags/scrolls on the map and it detects his finger's position on the map, is this possible?
Currently I was unable to stop the map's movements with
scrollEnabled
etc. props and found a way to stop it usingmaxBounds
on theCamera
component.However, I am not sure how to track the position of the finger on the map.
Dependencies:
"expo": "~52.0.25"
"react-native": "0.76.6"
"@rnmapbox/maps": "^10.1.33"
Beta Was this translation helpful? Give feedback.
All reactions