Open someall2003 opened 2 years ago
I suppose your array +i give rise to this route is far. You could "array.push([49.8567 + i/10, 5.3508+i/10]); " and "L.polyline(array).addTo(map);" to see the effect.
Hello, I am using the library and I have encountered the same problem. I tried to add the polyline on my map to check that the coordinates are correct. After verification it is correct, just when we pass in parameter a list of coordinates the markers do not move. Do you have any idea what could cause this?
This is my code
geoJsonData.features.forEach((feature) => { coords = feature.geometry.coordinates[0]; newCoords = []; coords.forEach((coord) => { newCoords.push([coord[1],coord[0]]) }) marker = L.Marker.movingMarker( newCoords,[5000], {autostart: true}).addTo(map); markerList.push(marker); })
The marker is simply drawn at the first position but don't move.
I am sorry that I didn't reproduce your question. But you could check the order of coordinates([lat,lng]), or I don't know is it reasonable about[5000]? You could refer to this blog. https://blog.csdn.net/qq_43143469/article/details/123258485 My English is not well, I hope it is useful.
At 2022-08-01 02:20:36, "wbelgada" @.***> wrote:
Hello, I am using the library and I have encountered the same problem. I tried to add the polyline on my map to check that the coordinates are correct. After verification it is correct, just when we pass in parameter a list of coordinates the markers do not move. Do you have any idea what could cause this?
This is my code geoJsonData.features.forEach((feature) => { coords = feature.geometry.coordinates[0]; newCoords = []; coords.forEach((coord) => { newCoords.push([coord[1],coord[0]]) }) marker = L.Marker.movingMarker( newCoords,[5000], {autostart: true}).addTo(map); markerList.push(marker); })
The marker is simply drawn at the first position but don't move.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
I am using Leaflet and the MovingMarker plugin. When I pass an array of hard-coded points, it works normally and the marker moves and loops. But when I pass the variable with an array it is not working. It cannot loop after moving the marker. var array=[] for (var i = 0; i < 3; i++) { array.push([49.8567 + i, 5.3508+i]); } var marker1 = L.Marker.movingMarker(array, [10000], { autostart: true, loop: true } ).addTo(map); with this code the loop is not working and the event end not firing?? can you help me please .