A simple solution is to add an Overlay, override the draw() method, and not
actually do any drawing, but simply use the method as a hook to know anytime
the map has potentially moved or zoomed.  The problem is, this will get
called more often than necessary, so you'll need some custom logic to decide
when the viewport has changed "enough" for you to make a new query.  This
shouldn't be too difficult however -- you can track the current center and
zoom in your Overlay subclass -- and you'd probably need some kind of logic
like this anyway.

Let me know how that works for you, or if it works at all.

Steve

On Mon, Jun 7, 2010 at 3:36 PM, Raymond Rodgers <[email protected]>wrote:

> I'm writing an app that will be doing queries based on what's currently
> viewable in a MapActivity. Currently, I've extended the MapActivity class
> and I'm implementing OnZoomListener and setting my activity class as the
> listener on the ZoomButtonsController. This works fine when the zoom buttons
> are used to zoom in and out, but when using the zoom gestures, onZoom()
> isn't getting called, although onVisibilityChanged() is. The problem is that
> onVisibilityChanged() is getting called any time the zoom controls are on
> screen, and not all map events that trigger the controls to be visible are
> zoom events.
>
> So what I'm wondering at this point is simply is there a better way to find
> out when the map has been zoomed [in or out]? I would think there would be
> some addListener method I could use to receive a zoom event so that I could
> do my query based on the MapView getLatitudeSpan()/getLongitudeSpan() and
> getMapCenter() functions, but I'm not seeing any such animal...
>
> Likewise, I would like to know when the map has been panned so I can get
> updated information.
>
> Does anyone have a better idea or solution?
>
> Thank you,
> Raymond
>
> --
> 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]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
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

Reply via email to