I think I see what he's saying.  The theory is that the Overlay's
draw() method would be called after a zoom, among other times.  You
could pass the Overlay a MapView to check over the zoom level, and
during the draw() method, see if it's changed.  If it has, that
effectively becomes your callback.  Don't have that Overlay draw
anything, respond to taps, etc, etc.

It definitely IS a workaround, but it sounds like it should work in
theory.  I'll give this a shot next time I have the chance (this, or
something like it, would also mean I can finally get rid of that
deprecated call to get the zoom buttons).  However, given how often
draw() is called otherwise (if I'm not mistaken, just about any map
movement would also do it on a frame-by-frame basis), wouldn't that be
not much better than polling?

On Feb 12, 2:16 am, JP <joachim.pfeif...@gmail.com> wrote:
> Not sure if I follow.
> As nothing is fired in the way of an Overlay - how would it know to do
> anything?
>
> On Feb 11, 11:02 pm, Hugo Visser <botte...@gmail.com> wrote:
>
>
>
> > As a work around, you don't need to poll...You can register an overlay
> > that doesn't draw anything and checks the current zoom level against
> > the previous draw zoom level and take it from there...On zooming there
> > will be a redraw of the map so it should work out fine.
>
> > On Feb 11, 8:23 pm, CaptainSpam <captains...@gmail.com> wrote:
>
> > > Ever since the update that allows multitouch gestures on the Maps app
> > > (pinch-zooming, mostly), I've noticed that apps using the Google Maps
> > > API also seem to automatically support it.  That, in and of itself, is
> > > good.  Convenient!
>
> > > However, my app has a need to know when the user has zoomed the map.
> > > As it stands now, I've just been watching over the only way this has
> > > been possible before: The zoom control buttons.  It appears that
> > > there's no callback to know when the map has been zoomed (only
> > > MapController commands to MAKE the map zoom), so developers don't
> > > appear to have any way of knowing if the zoom level was changed
> > > outside of their control (i.e. pinch-zooming) apart from constantly
> > > polling the MapView.
>
> > > Is there any good way around this, or is an update like this in the
> > > cards for the API?  Or am I just missing something obvious?

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

Reply via email to