Reputation: 3
I am working with Mapbox and trying to use the user location feature, but I am encountering an issue where the onUpdate function returns the user's position only when the component is initially loaded. Also, the location icon from UserLocation only appears on the first location and does not change its position, even if the location is changed on the phone. LocationPuck works flawlessly and changes his position on the map with each change of location in the emulator.
import { UserLocation } from '@rnmapbox/maps'
<UserLocation
visible={true}
onUpdate={(location: Location) => console.log('location', location)}
/>
I tried different versions of parameters, especially for renderMode (I saw that there was a similar report on github), but nothing helped. Is there something I'm not seeing here/might be doing wrong?
I also tried using locationManager, but the effect was similar.
Upvotes: 0
Views: 56
Reputation: 1779
I ran into the same issue with Expo and as of the 8th of February 2025 with Expo 52, React Native 0.76 and "@rnmapbox/maps": "^10.1.33",
the temporary solution is disabling the new architecture with
[...]
"newArchEnabled": false,
[...]
in your app.json.
I'll update this answer when and if a new version fixes the issue
Upvotes: 0