Follow user mode can't be set
See original GitHub issueBug description
followUserMode="compass"
changes back to null
and followUserLocation
to false
To Reproduce Steps to reproduce the behavior
<Mapbox.MapView
style={[
styles.map,
{ height, borderRadius: theme.roundness, overflow: 'hidden' },
]}
scrollEnabled={true}
zoomEnabled={true}
//
pitchEnabled={true}
rotateEnabled={false}
//
compassEnabled={false}
attributionEnabled={false}
localizeLabels={true}
logoEnabled={false}
styleURL={styleURL}
mode={Mapbox.UserTrackingModes.FollowWithHeading}
>
<Mapbox.Camera
followZoomLevel={config.initialZoomLevel}
followUserLocation={true}
followUserMode={'compass'}
onUserTrackingModeChange={onUserTrackingModeChange}
/>
<Mapbox.UserLocation visible animated />
</Mapbox.MapView>
const onUserTrackingModeChange = useCallback(event => {
event.persist()
console.log(event)
onUserTrackingModeChange result after init
nativeEvent:
payload:
followUserLocation: false
followUserMode: null
type: "usertrackingmodechange"
Expected behavior I want to have the same view as in the Mapbox Android example
Screenshots I get the wrong heading, no compass on the user location an no following in the rotation of the map.
Versions:
- Platform: Android
- Device: Oneplus A6003
- OS: Android 9
- React Native Version: 0.60.4
Context
UPDATE: after some digging and in RCTMGLCamera and disabling:
MapboxMap.CancelableCallback cameraCallback = new MapboxMap.CancelableCallback() {
@Override
public void onCancel() {
// mUserTrackingState = UserTrackingState.CHANGED;
}
@Override
public void onFinish() {
// mUserTrackingState = UserTrackingState.CHANGED;
}
};
It works! Seems like tracking change should not be changed too quick. updateUserLocationSignificantly updateUserLocationIncrementally
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:11 (7 by maintainers)
Top Results From Across the Web
Follow user mode can't be set · Issue #319 · rnmapbox/maps
When the map is fully rendered with my current zoom and coordinates, I set the followUserLocation state variable to true. Seems to work...
Read more >Unable to enter single user mode (to create Admin account)
To invoke Single User Mode afterwards, simply hold down Command-S while you turn on or restart your Mac. Windows will not boot unless...
Read more >FIX: You cannot set a SQL Server 2012 or 2014 database to ...
Fixes an issue in which you cannot set a SQL Server 2012 or 2014 database to single-user mode if the database is read-only....
Read more >How to Solve QuickBooks Multi-User Mode Not Working Error
A step by step guide on how to solve QuickBooks multi user mode not working error for QuickBooks desktop. Troubleshoot QuickBooks Error.
Read more >Multi User Mode Issues - QuickBooks - Intuit
The following are some reasons for QuickBooks multi-user mode not working: QuickBooks is not installed on the server.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I wanted to add that only commenting out the onFinish line for updateUserLocationSignificantly worked for me as well.
Instead of modifying the core library, I was also able to get rid of the issue by setting the followUserLocation property to a state variable that is false by default. When the map is fully rendered with my current zoom and coordinates, I set the followUserLocation state variable to true. Seems to work well so far.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.