Due to some constraints, that I will not go into, I have found myself needing to implement custom panning in my application.
The ArcGIS API reference suggests using the following methods:
IScreenDisplay2.PanStart(IPoint start) // Starts a pan IScreenDisplay2.PanMoveTo(IPoint moveTo) // Moves to a point IScreenDisplay2.PanEnd() // Ends the pan
Each of these methods is called in the following event handlers (respectively):
IMapControl4.OnMouseDown // Call PanStart() IMapControl4.OnMouseMove // Call PanMoveTo() IMapControl4.OnMouseUp // Call PanEnd()
So all of that works fine, the events are handled, the panning starts, everyone is happy.
Where the screen actually pans is not where I have dragged my cursor. The map slides around in a somewhat deterministic pattern, but I can't seem to figure out how to compensate for what the API is doing. I have been unable to find any enlightening documentation.
Does anyone have experience with this part of the API? Sample code or documentation would be great!