Closed MoussaRiad closed 2 years ago
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={[previousLatitude, previousLongitude]} />
Describe the bug I have added the leaflet-tracking-marker to my project( which is for now a map with simple markers), and followed the same code example hosted in codesandbox link , But it doesn't rendering anything ( the hole map), and it showed me in the console this error : Uncaught Error: Invalid LatLng object: (undefined, undefined)