[OpenLayers-Users] Re: Polygon doesn't align with baselayer with IE8
Jessica Lapointe
jlapointe at mapgears.com
Fri Apr 13 15:23:34 EDT 2012
Hello list,
I still have this problem, but I got a bit more information and examples.
I noticed that when you pan the map vertically, the offset between the
vectors and the baselayer changes. This can be reproduced in this
OpenLayers example: http://openlayers.org/dev/examples/wfs-states.html
In that case, in IE8, you have to zoom out of one zoom level. Then,
when you drag the map up and down, the states slightly shift as such:
http://i.imgur.com/REXsd.png
This is a lot more noticeable here, in an example I tried to keep as
simple as possible: http://dev8.mapgears.com/phac/test/map.html
In that case too, you can pan the map up and down to get this result:
http://i.imgur.com/H3vPc.png
Also, playing with the minscale value of the map, the zoom levels or
the size of the map's div may make the offset a bit better or worse,
which lead me to think there might be a rounding problem somewhere.
I hope someone can help, or at least find the real source of the problem !
Thanks,
Jessica Lapointe
On Mon, Mar 12, 2012 at 3:59 PM, Jessica Lapointe
<jlapointe at mapgears.com> wrote:
> Hi everyone,
> I display some wfs features over a baselayer. It looks great in all
> browsers but Internet Explorer, in which my country polygons are off
> by a few pixels. (Here's a screenshot: http://i.imgur.com/zPvq9.png )
> The error is more or less important depending on the zoom level, but
> it's never perfectly aligned as it is in chrome, firefox & safari.
>
> I use OpenLayers 2.11 and mapserver 6.0.1. I didn't try with other
> versions of IE.
> Below are my map and layers definitions.
>
> I have no idea how to fix this, so any clue would be appreciated.
> Thanks a lot,
> Jessica Lapointe
>
> var myextent = new OpenLayers.Bounds(-180, -90, 180, 90);
> var options = { minScale: 150000000,
> units: "degrees",
> restrictedExtent: myextent,
> numZoomLevels: 6,
> controls: [new OpenLayers.Control.Navigation(), new
> OpenLayers.Control.ArgParser()]
> };
> map = new OpenLayers.Map('map', options);
>
> //WMS Background world map layer
> var worldLayer = new OpenLayers.Layer.WMS("countries",
> host+"phac.map&service=WMS",
> {layers:
> 'countries,countrieslabels'},{'isBaseLayer':true, 'singleTile': false}
> );
> map.addLayer(worldLayer);
> worldLayer.events.on({
> "loadend":onWorldLoaded
> });
> //WFS feature layer
> //Colored countries
> countriesLayer = new OpenLayers.Layer.Vector("Countries", {
> styleMap: styleMapCountries,
> strategies: [new OpenLayers.Strategy.BBOX()],
> protocol: new OpenLayers.Protocol.WFS({
> url:host+"phac.map&service=WFS",
> featureType: "projectcountries",
> featureNS: "http://mapserver.gis.umn.edu/mapserver"
> }),
> visibility: true
> });
> countriesLayer.events.on({
> "loadend":onCountriesLoaded
> });
More information about the Users
mailing list