var lineLayer = new OpenLayers.Layer.Vector("Line Layer");
lineLayer.events.register("mouseover", lineLayer, function(e)
        {
                this.div.style.cursor = "pointer";
                var feature = this.getFeatureFromEvent(e);
                if(feature)
                        alert(feature.attributes.name);
        });
var polygonLayer = new OpenLayers.Layer.Vector("Polygon Layer");
polygonLayer.events.register("mouseover", polygonLayer, function(e)
        {
                this.div.style.cursor = "pointer";
                var feature = this.getFeatureFromEvent(e);
                if(feature)
                        alert(feature.attributes.name);
        });
map.addLayer(lineLayer);
map.addLayer(polygonLayer);

in this example, the polygonLayer will cover the lineLayer. the
polygonLayer's 'mouseover' event can be triggered, and alert
something. but when i mose move to the line feature in lineLayer, the
mouse cursor can become to 'pointer'. but the 'alert' function can not
be invoked. it means the feature what i want to get has not been
chosed.
all of the features can be displayed normally.
IE7 FF do not have this issue.
thanks in advance. :-)

2008/10/19, Eric Lemoine <[EMAIL PROTECTED]>:
> Hi. With multiple vector layers events work only for the elements of
> the layer on top of the others. I'm suprised you're observing
> different behavior on IE6, IE7 and FF with that respect. A simple
> example would help us understand the issue. Eric
>
> 2008/10/16, dequan chen <[EMAIL PROTECTED]>:
>> hi.
>> I use more than one openlayers vector layer to overlay the map. every
>> layer
>> has its event. in IE6, the upper layer covers completely the lower layer.
>> so, the other vector layer event can not be triggered. in IE7 or firefox,
>> there's no this issue.
>> I try to render the vector layer div border, and find the div fill the
>> entire map. in IE7 or firefox, the border shrinks to the top left corner.
>> so
>> the layer don't cover the lower layer.
>> how to solve this problem ? thanks. :-)
>>
>
_______________________________________________
Dev mailing list
[email protected]
http://openlayers.org/mailman/listinfo/dev

Reply via email to