-
-
Notifications
You must be signed in to change notification settings - Fork 860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Android - Compass not rotating on initial load #2543
Comments
I am experiencing the same problem. Any news here? |
In my case I am using 10.0.0-beta.69 |
This was the component I've used to reproduce in our test app: import MapboxGL, { MapView } from '@rnmapbox/maps';
import { Button, Text, View } from 'react-native';
import React, { useState } from 'react';
function PageMap({navigation}) {
const [compassWorking, setCompassWorking] = useState(false);
return (
<View style={{ flex: 1 }}>
<Button
title="go to OTHER screen"
onPress={() => {
setCompassWorking(true);
navigation.navigate('ScreenWithoutMap');
}}
/>
<Text>
{compassWorking
? 'Now the compass rotating well'
: 'The compass not rotating until you go to another screen and go back to this screen'}
</Text>
<MapView
style={{ flex: 1 }}
compassEnabled={true}
rotateEnabled={true}
scrollEnabled={true}
pitchEnabled={true}
/>
</View>
);
}
const fullPageStyle = {
width: '100%',
height: '100%',
backgroundColor: '#FF000022',
};
export default PageMap; |
Actually still see the issue Some notes to myself, when it's working it's working via this: onCameraMove:188, CompassViewPlugin
lambda 'forEach' in 'onCameraMove':153, MapPluginRegistry
onCameraMove:152, MapPluginRegistry
_init_$lambda-0:83, MapController
...
onCameraChanged:-1, MapController$$ExternalSyntheticLambda1
..
setCamera:-1, CameraManager |
As of the past month on Android we've had to explicitly call |
Mapbox Implementation
Mapbox
Mapbox Version
10.7.0
Platform
Android
@rnmapbox/maps
version10.0.0-beta.64 & 10.0.0-beta.62
Standalone component to reproduce
Observed behavior and steps to reproduce
The compass on initial load of MapView not rotating until you go to another screen, and go back to the screen with the map.
After go to antoher screen and go back to the screen map, the compass work perfectly.
Expected behavior
Compass rotate on the first render of MapView
Notes / preliminary analysis
Android version : 12 SP1A.210812.016
Development environment
Using Expo 47.0.0
Packages version tested :
@react-navigation/native : 6.1.2 & 6.0.10
@react-navigation/stack : 6.3.11 & 6.2.1
@rnmapbox/maps : 10.0.0-beta.64 & 10.0.0-beta.62
expo : 47.0.0
Maybe kinda related to these pull requests :
#2427
#2352
Additional links and references
You'll need these two libs in addition for make the exemple work :
I think you can copy/paste the exemple ( except the MAPBOX_ACCESS_TOKEN ) and see what is going wrong.
Do you think you could make it rotate work for the next beta version ?
Or maybe you got a little hack in React-native to resolve this ?
BIG Thanks for providing this lib 👍
The text was updated successfully, but these errors were encountered: