[OpenLayers-Dev] ??: openlayers problem in IE6

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


Oops, I missed that email. I will also try to play with the doctype
tomorrow and see where that leads us. Thanks. Eric

2008/10/20, dequan chen <cdqrain at gmail.com>:
> hi Matthias Pohl. thanks
>
> sorry for forgetting to mention that if you remove <!DOCTYPE html
> PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> or just
> remove the segment of
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" from the
> page. IE7 FF will not work too.
> So, I think IE6 do not according to the W3C standard even though we
> add this DOCTYPE in page.
>
> 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 Layer");
>             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("Polygon Layer");
>             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));
>
> this code tests success in IE7 and FF, but not in IE6.
> if i remove DOCTYPE, all of the browsers do not work. only top vector
> layer event triggered.
>
> I think, it is the core problem.
>
> 2008/10/20, Matthias Pohl <m.pohl at m-click.de>:
>> @dequan chen
>>
>> Beside the problem with IE6 you wrote that your example will work with FF.
>>
>>> all of the features can be displayed normally.
>>> IE7 FF do not have this issue.
>>
>> I tried to make your example work with FF2 and FF3, but with no success.
>> Only the top vector layer can trigger the mouseover event.
>>
>> Can you provide a link to a working example on the web?
>>
>> Regards, matt
>>
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev
>



More information about the Dev mailing list