Created
March 3, 2016 05:51
-
-
Save vladimirlukyanov/fa09a73c3a4dd9e40eca to your computer and use it in GitHub Desktop.
Leaflet distance calculation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map.on('zoomend dragend', function (e) { | |
if(e.type == 'dragend') { | |
// Drag event | |
var distance = e.target.dragging._draggable._newPos.distanceTo(e.target.dragging._draggable._startPos); | |
console.log(distance); | |
} else { | |
// Zoom event | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment