Best way to figure out when user stops panning

2572
4
05-14-2014 09:03 AM
JosephDwyer
New Contributor II
I looking for a way to know when the user has stopping panning so I can get the center point of the map and figure out the closest address to that point.  I know how to get the address but I don't want the app try and fire off a request every time the onPanListener fires.  Only when it stops firing.  If anyone has a solution I would love to see how you implemented the solution.
0 Kudos
4 Replies
MichaelBucari-Tovo
New Contributor II
In the OnPanListener, the postPointerUp function is fired when the user lists his finger from the screen after panning. Unfortunately, if the user flicks the screen, there's no way to tell where the map eventually lands (that I've found).  The best I could do was to set a location check on a timer to periodically check if the map center had changed.
0 Kudos
ShellyGill1
Esri Contributor
Possibly the reply I posted to this other thread may help with these questions:
http://forums.arcgis.com/threads/110326-onPanListener-issues-after-sdk-update-from-10.1.1-to-10.2.3?...
0 Kudos
KevinKrumwiede
New Contributor
Use a Handler.  Post a Runnable with a delay whenever the OnPanListener fires.  If the listener fires again before the task runs, cancel the task and post it again.
0 Kudos
RudolfKopriva1
New Contributor
You can try to override the onFling in your MapOnTouchListener. You can't just cancel it, because it would not refresh the map view, but you can call it with the following parameters: return super.onFling(to, to, 0, 0). This should disable the fling.
0 Kudos