1

We are having a problem with fast drag event on the new esri js 4.6 api. When a user drags the map too fast, the map extent's changes rapidly. I've detected that on a fast drag, there's an animation event, which is not documented. The goTo() function also fires an animation, but it accepts duration, speed and easing as parameters. A hacky solution is submitted as an answer, I'm still looking for a straight api approach.

0

In the drag event I've changed the value of a global 'myDrag' variable to true
view.on('drag', function () { myDrag = true; })


This code is used to detect an active animation and to stop it if it's resulted from a drag event
(In order not to prevent all animations).
watchUtils.when(view, "animation", function(animation) { if (myDrag) animation.stop(); // Stops the animation. });
And reset the myDrag variable in the stationary state
watchUtils.whenTrue(view, "stationary", function(e) { myDrag = false; });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.