Skip to content

[Bug]: Render Error : undefined is not an object (evaluating '_maps.default.UserTrackingModes.FollowWithCourse') #2226

@MagdaHennebo

Description

@MagdaHennebo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions