[OpenLayers-Users] Controls and map events

Attila Csipa plists at prometheus.org.yu
Fri Jan 11 16:21:36 EST 2008


On Friday 11 January 2008 17:49:09 Eric Lemoine wrote:
> > In any case (in mine DragHandler
> > and a 'click' Map.Event above a feature), I've tried setting both
> > true/false manually but that did not change much as (according to my
> > admittedly poor firebug skills) the event still gets stopped in somebodys
> > OpenLayers.Handler.Feature (maybe it needs a stopDown property, too, or
> > modification to a common ancestor ?).
>
> I'm having trouble following you here. Could you post some code?

Yes, I outdid myself with the parentheses, sorry about that. The code:

var drag = new OpenLayers.Control.DragFeature(pointlayer,{
                onStart: function(feature, pixel)
                {
                        storeGeometry(feature.geometry);
                },
                onComplete: function(feature, pixel)
                {
			processNewGeometry(feature.geometry);
                }
        });

        drag.dragHandler.stopDown = false;
        map.addControl(drag);
        drag.activate();
        map.events.register("click", map, function(e) {
              var lonlat = map.getLonLatFromViewPortPx(e.xy);
              alert("You clicked near " + lonlat.lat + " N, " +
                                          + lonlat.lon + " E");
        });

What I want to do is to preserve 'click' functionality even if the click 
happened over a draggable feature. pointlayer is a GML layer containing 
features with point geometries. What happens in the svn version is that in 
pointlayer.events, Events.js on line 627, after Handler.Drag returns 
continueChain = true due to the stopDown property, but on the call to the 
next listener (a Handler.Feature), continueChain = false and thus it doesn't 
fall through to other elements. I'm still familiarizing myself with OL 
structures, so my assessment might be wrong of course...



More information about the Users mailing list