Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
How to pan a leaflet map to the point when a marker is dragged?
startMarker.on('dragged', function(event) {});
用这个
startMarker.on('dragend', function(event) { map.setView(new L.LatLng( event.target.getLatLng().lat,event.target.getLatLng().lng),zoom); });