Hello,

I'm running into the exact same issue you are, I need a way to figure
out when the user finishes moving the map around so I can fetch fresh
data from a XML source. This is really easy to do using the Maps API
for Javascript, but the Android Maps API doesn't have anything like
it.

I've been researching for a few hours and this solution you posted
here is the only one I've found to this problem, this sounds like a
bit of a hack though since you'd probably have to use an additional
Overlay that can handle the event on the MapView, it sucks that there
isn't something more elegant. The alternative I found is to use a
WebView that can handle the Javascript version instead of a
MapActivity... which may work for my purposes, but no clue if it's
what you're looking for.

Eduardo

On Apr 3, 4:41 am, patbenatar <[email protected]> wrote:
> Alright just had a revelation on my drive home from the office... If
> there is no built-in functionality to handle this, here's what I plan
> on doing:
>
> After a finger up event, start polling the map for it's centerpoint
> every 50ms or so and store the point in an instance variable. Check
> the stored centerpoint against each new centerpoint and if it's
> different, overwrite the store. Otherwise stop the timeout and we now
> know thepanningis complete.
>
> The only problem I see with this is that from reading around the Web
> it seems that clicking on the zoom controls will fire a finger up
> event on the MapView... I haven't verified this behavior but others
> apparently have.. Two possible fixes I can think of: 1) Subclass the
> zoom controls [if possible] and override it to consume the event so
> finger up won't bubble to the MapView. 2) Don't worry about the event
> bubbling, but rather check if the View the finger up event was fired
> on is the zoom controls view or not.
>
> Any input before I try this out?
>
> Thanks,
> Nick
>
> On Apr 3, 2:49 am, Nick Giancola <[email protected]> wrote:
>
>
>
> > Hey all-
>
> > I need to know when the user ispanningthe map so I can check if they've 
> > panned outside of the initial radius that I fetch data from the API with 
> > when the app launches. If the user pans outside this radius, when they 
> > stoppanningI will get the new center point of the map and fetch new data 
> > with that geo-point. So far I can't find anything in the Google Maps API 
> > docs [and I've inspected the entire class tree] that notifies developers 
> > when any animation actions are occurring or completed.. It seems weird that 
> > Google wouldn't give us some sort of event listener or protected method to 
> > override on the MapView or something to do this.
>
> > I looked into what methods were available to override on the View class and 
> > it does have onAnimationEnd() but I guesspanningor zooming the map doesn't 
> > count as an animation or is never passed up from the MapView or 
> > something... I tried running a simple log in onAnimationEnd() and it is 
> > never being called...
>
> > Any help here would be great! Searching the interwebs gave me nothing but 
> > some never-successfully-answered posts.
>
> > Thanks so much,
> > Nick

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to