[OpenLayers-Users] NavToolBar events
Andreas Hocevar
ahocevar at opengeo.org
Fri Jun 12 02:12:48 EDT 2009
Hi Brad,
On Fri, Jun 12, 2009 at 4:04 AM, Brad Spencer<brad at cubewerx.com.au> wrote:
> I have a need to change states within my application - i.e. standard
> ‘viewing mode’ with the standard navigation defaults set and then to switch
> to a ‘select mode’ that changes these defaults for application specific
> purposes. I have this working just fine with the use of my own mode control
> button that switches me back and forth.
>
> However, when the user hits the navToolbar to mouse-drag-zoom around the
> map, I have no way of knowing this has happened and consequently I am unable
> to reset my mode control button. I do not want to remove the navToolbar as
> it is very useful.
Not sure if I understand your question right: you want to set the
application back to viewing mode as soon as the user messes with the
PanZoomBar (assuming this is what you mean by navToolbar)?
If so, you could just register a listener for the map's moveend event.
This will be triggered with everything that a user can do in the
PanZoomBar.
> I was wondering if there is a way to register an event on the navToolbar’s
> mouse-drag-zoom button so that I can correctly set my status button.
Or maybe you just want to set the application back to viewing mode
when the user zooms the map using the ZoomBar? In that case, you
register for the zoomend instead of the moveend event.
I hope this answer helps.
Regards,
Andreas.
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
More information about the Users
mailing list