문제

The following instruction won't work as I expect:

map.panTo(e.latlng, {animate: true, duration: 1.0});

I've tried different values : 0.5, 1.0, 10.0, 1000.0, 1, 10 but the panning is just as fast!

Any idea? Thanks!

도움이 되었습니까?

해결책

Are you sure you're using the latest Leaflet version? I just tried this code in 0.6.4 and it worked perfectly, panning slowly as expected:

map.on('click', function (e) {
  map.panTo(e.latlng, {animate: true, duration: 5.0});
});
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top