[Bug]: Render Error : undefined is not an object (evaluating '_maps.default.UserTrackingModes.FollowWithCourse')
Mapbox Implementation
Mapbox
Mapbox Version
default
Platform
iOS, Android
@rnmapbox/maps version
#main
Standalone component to reproduce
import React, { useState } from 'react'; import MapboxGL from '@rnmapbox/maps';
const Camera = (props) => {
const [zoom, setZoom] = useState(12);
if (props && props?.coordinates?.pointsOfInterest?.length > 0) {
return (
<MapboxGL.Camera
zoomLevel={zoom}
centerCoordinate={[
props?.coordinates?.pointsOfInterest[0]?.longitude,
props?.coordinates?.pointsOfInterest[0]?.latitude,
]}
animationDuration={10}
animationMode={'none'}
followUserLocation={true}
followUserMode={MapboxGL.UserTrackingModes.FollowWithCourse}
followZoomLevel={zoom}
/>
);
}
};
export default Camera;
Observed behavior and steps to reproduce
[Bug]: Render Error : undefined is not an object (evaluating '_maps.default.UserTrackingModes.FollowWithCourse')
Expected behavior
The map should appear, the camera should start at the coordinates sent through props (latitude, longitude) and the camera should follow the user's location...
Notes / preliminary analysis
I am fairly new to mapbox, and I don't really know what could be wrong here...
Additional links and references
No response
The issue seems to be this line.
followUserMode={MapboxGL.UserTrackingModes.FollowWithCourse}
as a workaround you can try with the actual value "course":
followUserMode={"course"}