openlayers problem in IE6

Topics: General Topics, SharpMap v0.9 / v1.x
Oct 15, 2008 at 7:29 AM
Edited Oct 15, 2008 at 7:43 AM
hi,JohnDiss.
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 ? or how to put this question on Openlayers offical website?
thanks. :-)
Coordinator
Oct 15, 2008 at 10:32 AM
Hi cdgrain, I am not familiar with this issue, but I have seen special ie6 style handling in the latest version of openlayers (currently 2.7 at the time of writing) upgrading may help. OpenLayers trouble tickets can be opened here http://trac.openlayers.org/ hth jd
Oct 24, 2008 at 9:12 AM
Edited Oct 24, 2008 at 9:29 AM
hi, JohnDiss

I'v put forward this issue on OpenLayers mail list. and some one try to resolve this problem. but he said there's no solution to this issue possibly. his name is Eric Lemoine, i don't know if he is a OpenLayers developement member.

I paste code here, and can you try to analysis it? thanks.

first, add <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> to the page. If not, IE7 will not work too.

var map = new OpenLayers.Map('map');
           var layer = new OpenLayers.Layer.WMS("OpenLayers WMS",
                   "http://labs.metacarta.com/wms/vmap0", { layers: 'basic' });
           map.addLayer(layer);
           map.addControl(new OpenLayers.Control.LayerSwitcher());

           var lineLayer1 = new OpenLayers.Layer.Vector("Line Layer1");
           var pts = [];
           pts.push(new OpenLayers.Geometry.Point(0, 1));
           pts.push(new OpenLayers.Geometry.Point(12, 50));
           var line = new OpenLayers.Feature.Vector(new
OpenLayers.Geometry.LineString(pts), null,
OpenLayers.Feature.Vector.style['default']);
           lineLayer1.addFeatures([line]);
           lineLayer1.events.register("mouseover", lineLayer1, function(e) {
               this.div.style.cursor = "pointer";
               var feature = this.getFeatureFromEvent(e);
               if (feature)
                   alert("LineLayer1");
           });
           var lineLayer2 = new OpenLayers.Layer.Vector("LineLayer2");
           var pts = [];
           pts.push(new OpenLayers.Geometry.Point(-70, -10));
           pts.push(new OpenLayers.Geometry.Point(12, 50));
           var line = new OpenLayers.Feature.Vector(new
OpenLayers.Geometry.LineString(pts), null,
OpenLayers.Feature.Vector.style['default']);
           lineLayer2.addFeatures([line]);
           lineLayer2.events.register("mouseover", lineLayer2, function(e) {
               this.div.style.cursor = "pointer";
               var feature = this.getFeatureFromEvent(e);
               if (feature)
                   alert("LineLayer2");
           });
           map.addLayer(lineLayer1);
           map.addLayer(lineLayer2);

           map.setCenter(new OpenLayers.LonLat(0, 0));

IE6, FF only alert "LineLayer2". IE7 can alert "LineLayer1" and "LineLayer2".
I don't know which browser behave right.

I find dean.edwards do a good work on IE6 patch to make it respect to W3C standard. http://ie7-js.googlecode.com
but, it still can not solve this problem.
Coordinator
Oct 24, 2008 at 10:23 AM
Hi cdgrain, this sounds like your problem http://trac.openlayers.org/ticket/434 it seems to have been resolved and then reopened. I think Eric Lemoine is an OpenLayers dev.. I am not sure which browser is right, but most useful would be if you register for an event you get it regardless of whether it is topmost or not.. cheers jd
Oct 30, 2008 at 2:23 AM
hi, John
this ticket still not resolve the problem.
the demo website http://sama.asia/ola/mulafese-demo.html will not work in IE6 but work in FF3.
I think my problem is a hard work.