2008/10/19 dequan chen <[EMAIL PROTECTED]>:
> 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
Test
Test
Test
_______________________________________________ Dev mailing list [email protected] http://openlayers.org/mailman/listinfo/dev
