Blue dot bouncing around on android
Summary
Although my device is stationary, the blue dot seems to constantly bounce around non stop. Seems like onUserLocationChange is stuck on a loop, and when logged the accuracy/coordinates are always different than the previous value.
This is happening on both the simulator and all physical devices. Logging the user coordinates from our geolocation package looks normal, but for some reason react-native-maps cant seem to pinpoint the user coordinates and just keeps guessing every few seconds
https://github.com/react-native-maps/react-native-maps/assets/59587976/f49b80ad-fb3c-49ea-bc7c-31cd142ff7d7
Reproducible sample code
<MapView
ref={mapRef}
provider={PROVIDER_GOOGLE}
style={styles.map}
customMapStyle={mapStyle === 'light' ? lightModeMap : darkModeMap}
onPanDrag={() => {
if (selectedTeamMember) setSelectedTeamMember(undefined);
}}
onUserLocationChange={(val) => console.log(val.nativeEvent)}
showsCompass={true}
showsUserLocation
maxZoomLevel={20}
showsMyLocationButton={false}
followsUserLocation={followUser}
onRegionChange={() => console.log('regionChanged')}
onRegionChangeComplete={() => console.log('regionChangeComplete')}
mapType={mapStyle === 'satellite' ? 'satellite' : 'standard'}
region={{
latitude: userGeoLocation.latitude || 0,
longitude: userGeoLocation.longitude || 0,
latitudeDelta: 0.01,
longitudeDelta: 0.01,
}}
>
Steps to reproduce
run on an android device and zoom in to the blue dot and watch it dance
Expected result
The user location should be stationary as it is on ios if the device is not moving
Actual result
The blue dot is bouncing around.. it cant seem to get my precise loction
React Native Maps Version
1.9.1
What platforms are you seeing the problem on?
Android
React Native Version
72.5
What version of Expo are you using?
Not using Expo
Device(s)
pixel, all galaxies
Additional information
I have precise location on, and we're using always on location
Hi @1kDustin can you please provide full reproducible code sample? What geolocation package + version are you using? Also are you sure it is not related to poor GPS signal strength?
@jan-kozinski this is happening on android even without using my geolocation package in the region. im sorry i should have removed that from the comment above.
<MapView provider={PROVIDER_GOOGLE} style={styles.map} showsCompass={true} showsUserLocation maxZoomLevel={20} showsMyLocationButton={false} followsUserLocation={true} onUserLocationChange={(e) => console.log(e.nativeEvent.coordinate?.latitude, e.nativeEvent.coordinate?.longitude) } >
using this alone gives me different locations every 2-3 seconds in the logs for android alone. I've commented everything in the entire file other than the code pasted. the coordinates are coming straight from the native event, not my location package. its not poor GPS signal strength as the google maps app works fine, and this is happening for testers as well. I've noticed so far this doesnt happen on pixel devices.. seems to be on galaxy devices so far from what i've gathered
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If the issue remains relevant, simply comment Still relevant and the issue will remain open. Thank you for your contributions.