- router.moveListenerOn = function() {
- map.on('moveend', router.updateHash);
+ router.withoutMoveListener = function (callback) {
+ function disableMoveListener() {
+ map.off("moveend", router.updateHash);
+ map.once("moveend", function () {
+ map.on("moveend", router.updateHash);
+ });
+ }
+
+ map.once("movestart", disableMoveListener);
+ callback();
+ map.off("movestart", disableMoveListener);