[OpenLayers-Users] OT: Event propagation problem...

Jeff Dege jdege at korterra.com
Thu Nov 29 11:42:23 EST 2007


I had a similar problem, and I hacked in a little kludge to allow me to turn off event propogation entirely:

	var map = new OpenLayers.Map('map', mapOptions);
	
	//This is a serious kludge, to allow us to turn off event handling on the map,
 	//when OpenLayers supports no such functionality.
	map.events.idle = false;
	map.events.originalTriggerEvent = openLayersMap.events.triggerEvent;
	map.events.triggerEvent = function(type, evt) {
		if (this.idle) return;
		this.originalTriggerEvent(type, evt);
	};

It's ugly, and it may get me into real trouble, some time in the future, but it works.

If I set map.events.idle = true, no events fire at all.


-----Original Message-----
From: Steve Lime [mailto:Steve.Lime at dnr.state.mn.us]
Sent: Wed 11/28/2007 5:12 PM
To: Jeff Dege; users at openlayers.org
Subject: RE: [OpenLayers-Users] OT: Event propagation problem...
 
No response at all, the content covers the whole map interface at the moment. Whether that works as a design (from a user perspective) is yet to be seen.

Steve

>>> On 11/28/2007 at 5:01 PM, in message
<34E056CD4D475841B8C9ABCE956F92F615A37B at mrburns.KorOffice.local>, "Jeff Dege"
<jdege at korterra.com> wrote:
> Do you want the map to not respond to clicks on your help or legend div?
> 
> If so, you'll need to define event handlers, the way Popups do.
> 
> Or do you want the map to not respond at all, while your help or legend is 
> visible?
> 
> 
> -----Original Message-----
> From: users-bounces at openlayers.org on behalf of Steve Lime
> Sent: Wed 11/28/2007 4:56 PM
> To: users at openlayers.org 
> Subject: [OpenLayers-Users] OT: Event propagation problem...
>  
> Hi all: Slightly off-topic question. I'm working on an interface that plops 
> help and legend content over the top of an OpenLayers
> map. Problem is that mouse events continue to propagate through the help or 
> legend content to OpenLayers. Anyone aware of
> an easy way to stop that or do I need to go ahead and define event handlers 
> (that do nothing) for the div that holds this other
> content?
> 
> Steve
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org 
> http://openlayers.org/mailman/listinfo/users


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20071129/fa88e77e/attachment.html


More information about the Users mailing list