Skip to content
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]: Render Error : undefined is not an object (evaluating '_maps.default.UserTrackingModes.FollowWithCourse') #2226

Closed
MagdaHennebo opened this issue Sep 19, 2022 · 1 comment · Fixed by #2242
Labels
bug 🪲 Something isn't working good first issue Good for newcomers

Comments

@MagdaHennebo
Copy link

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

@mfazekas
Copy link
Contributor

The issue seems to be this line.

followUserMode={MapboxGL.UserTrackingModes.FollowWithCourse}

as a workaround you can try with the actual value "course":

followUserMode={"course"}

@mfazekas mfazekas added bug 🪲 Something isn't working good first issue Good for newcomers labels Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants