[OpenLayers-Dev] openlayers problem in IE6

Eric Lemoine eric.c2c at gmail.com
Mon Oct 20 11:18:13 EDT 2008


2008/10/19 dequan chen <cdqrain at gmail.com>:
> 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. :-)

I tested your code and it works neither in FF nor in IE7. The example
I used is attached to this email. I'd be very very curious to know how
you got this to work, so please send me a complete example
demonstrating it works (possibly based on my example). Thanks,

PS: you just need to drop the html file into OpenLayers' examples dir.
--
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20081020/2f8e7b58/multi-vector-layers.html


More information about the Dev mailing list