Kinetic Panning Via The ESRI JavaScript API

3921
35
09-29-2012 11:37 PM
jeffpalus
New Contributor III
Just to be consitent with other ESRI web mapping API's, please add kinetic scrolling (aka inertia scrolling) feature, like the way the map pan move in bing & google maps. When you pan around on the map, the expected behaviour is for the map the continue to slide proportionally to the speed you dragged/panned the map.

When the user drag the map, the map moves smoothly.
When the user release the left mouse button the map does not stop straight, but stops by the power of dragging the map you made.
0 Kudos
35 Replies
ryanmordoff
New Contributor II
Hello all, here is the link to my implementation.  Let me know if you have any issues/comments.

Source - https://github.com/rymor/esri-kinetic-panning

Live Demo - http://rymor.github.io/esri-kinetic-panning/index.html
0 Kudos
mykLT
by
New Contributor II
Thank You for sharing. I used params displacementMouseMultiplier: 15 and deceleration: 0.85 for best effect.

I found one issue: if KineticPanning module is created after map is loaded - it works incorrectly (if two mouse drags are done one after another, first panning effect is stopped and second is starting from previous extent).
0 Kudos
MarkHoover
Occasional Contributor II
Any plans to get this working for IE 8 or any idea why it doesn't?  Sadly, it is the current default browser installed on machines throughout my company.  Works great on IE 9 though!
0 Kudos
ryanmordoff
New Contributor II
Thank You for sharing. I used params displacementMouseMultiplier: 15 and deceleration: 0.85 for best effect.

I found one issue: if KineticPanning module is created after map is loaded - it works incorrectly (if two mouse drags are done one after another, first panning effect is stopped and second is starting from previous extent).


Thanks for pointing out the issue.  I will look into it and try to get it resolved in a couple of days.
0 Kudos
ryanmordoff
New Contributor II
Any plans to get this working for IE 8 or any idea why it doesn't?  Sadly, it is the current default browser installed on machines throughout my company.  Works great on IE 9 though!


Yes, my plan is to get it working in ie8, haven't had a chance to troubleshoot it yet though.  I will reply back once I get it fixed.
0 Kudos
mykLT
by
New Contributor II
I noticed that map parameter should not be passed for mouseEvents and touchEvents, because they generate map click events and this can cause problems (for eg. draw toolbar is connecting on map click event to handle draw ending).

Also it fails when trying to zoom at panning time. Zooming begins from first pan movement point.
0 Kudos
ryanmordoff
New Contributor II
I noticed that map parameter should not be passed for mouseEvents and touchEvents, because they generate map click events and this can cause problems (for eg. draw toolbar is connecting on map click event to handle draw ending).

Also it fails when trying to zoom at panning time. Zooming begins from first pan movement point.


Thanks, adding to my list of bugs.
0 Kudos
SteveCole
Frequent Contributor
Wow. +100 internets to you, Ryan for this. So much better than the default panning behavior. I also need to support pre IE-9 so I'll wait on the sidelines until you get that bug worked out. Great job!
0 Kudos
ryanmordoff
New Contributor II
Wow. +100 internets to you, Ryan for this. So much better than the default panning behavior. I also need to support pre IE-9 so I'll wait on the sidelines until you get that bug worked out. Great job!


Hey, glad you like it.  Go ahead an give it another try, it should be working on ie8 now.

If anyone else has any issues, go ahead and fill out an issue for the project and I will get to them when I can - https://github.com/rymor/esri-kinetic-panning/issues
0 Kudos
MarkHoover
Occasional Contributor II
Is the live demo no longer working?  I can't seem to access it.
0 Kudos