[OpenLayers-Dev] NavToolbar control

jonz jonathan.zaid at mediolanum.it
Fri Sep 14 08:05:25 EDT 2007


Hi Christopher,

I was running into the same sort of thing, and basically it's sort of
impossibile to deactivate the zoombox without causing a zoom seeing as the
mouseup goes thru to the map.. Ok as far as your response.
I set up a simple "workaround" that seems to do the trick.

after I activate the zoombox I set up my own priority handler on the mouseup
so I get it before the map 
gets it.

control_ZoomBox.activate();
map.events.registerPriority("mouseup", this, this.mouseup);

then the event handler checks to see if we were dragging, via the
dragHandler. If so then we let the mouseup bubble back up, otherwise we let
the mouseup die here. Works great for me. Don't know if there
are any side effects that I haven't found yet.

		function mouseup(evt)
			{
			if (this.control_ZoomBox.handler.dragHandler.dragging)
				{
				return(true);
				}
			else
				return (false);
			}

---------------------

Jon




Christopher Schmidt-4 wrote:
> 
> On Tue, May 22, 2007 at 09:57:02AM -0500, Les Szklanny wrote:
>> When clicking the NavToolbar toggle, the map's mouseup event fires...
>> I believe this is a bug.  I'm using  OL '$Revision: 3113 $' on FF 2.0.
> 
> This is expected behavior. In order to allow the 'zoombox' to be
> released while the mouse is over a control, the controls are designed to
> pass mouseup through to the map. 
> 
> Regards,
> -- 
> Christopher Schmidt
> MetaCarta
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
> 
> 

-- 
View this message in context: http://www.nabble.com/NavToolbar-control-tf3796903.html#a12673789
Sent from the OpenLayers Dev mailing list archive at Nabble.com.




More information about the Dev mailing list