Skip to content
Discussion options

You must be logged in to vote

Hello @MoussaRiad,

const [currentTrack, setCurrentTrack] = useState({});

In my example, the "currentTrack" is an object not an array, it represents one coordinate of your marker, latitude and longitude, defined by an object with two properties, "lat" and "lng".

I then destructure this "data" object and send its "lat" and "lng" values to the tracking marker as an array (see the code snippet bellow)

But this is just my example, you can handle your data differently in your project as long as you make sure that you are sending the "position" and "prevPos" to **LeafletTrackingMarker ** in the required format.

<LeafletTrackingMarker icon={icon} position={[latitude, longitude]} previousPosition={[

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MoussaRiad
Comment options

Answer selected by alexandra-c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #10 on April 20, 2022 14:35.