JSim

Middle Mouse Panning

Discussion created by JSim on Jun 12, 2014
Has anybody come up with a solution for panning the map with the middle mouse button?

I'd like to be able to add support for this in my application (users want it as it is in ArcMap) but I don't think it is built into the API.

My current plan is to add one mouse listener for mouse down (and check that it is middle mouse) that when triggered will add two other mouse listeners for mouse move and mouse up (mouse up doing middle mouse check again). The mouse move listener will trigger a map.panTo() with the current screen position. The mouse up listener will do clean up and stop the panning. Has anyone tried something similar?

Thanks,
- Jamie

Outcomes