1

How to pan a leaflet map to the point when a marker is dragged?

startMarker.on('dragged', function(event) {});
4

1 回答 1

3

用这个

startMarker.on('dragend', function(event) {
 map.setView(new L.LatLng( event.target.getLatLng().lat,event.target.getLatLng().lng),zoom);
});
于 2013-07-17T10:10:10.443 回答