닫기가 완료되었습니다. 당신은 전단지 플러그인을 선택하고 꽤 정확한 목표를 가지고 있습니다. here의 설명을 따라하면됩니다.
// here is the path (get it from where you want)
var coordinateArray = [ [0,1], [1,1], [1,0] ];
// or for example
var coordinateArray = existingPolyline.getLatLngs();
// here is the line you draw (if you want to see the animated marker path on the map)
var myPolyline = L.polyline(coordinateArray);
myPolyline.addTo(map);
// i don't know if i understood your question correctly
// if you want to put a marker at the beginning and at the end of the path :
var mstart = L.marker(coordinateArray[0]).addTo(map);
var mend = L.marker(coordinateArray[coordinateArray.length - 1]).addTo(map);
// here is the moving marker (6 seconds animation)
var myMovingMarker = L.Marker.movingMarker(coordinateArray, 6000, {
autostart: false
});
map.addLayer(myMovingMarker);
myMovingMarker.start();
작동 감사 :
은의 그 구현하자 –