[OpenLayers-Dev] strange raster map behaviour

Stefanie Weykam stefanie at weykam.net
Fri Mar 26 08:56:13 EDT 2010

Hi list members,

We are observing very strange raster map behaviour – our raster maps are 
rendered with a shift towards south and east. The shift magnitude also 
seems to be scale dependant (a bit more in x and less in y). SingleTile 
gives different results. Still, both are not in the right place.

The maps are correctly displayed in another client (gvSIG) so the WMS 
should be alright.

Also note that a GetFeatureInfo request returns the correct value (right 
value in the right place).
Could it be a rendering artefact ?? Is there any workaround?

Additional info:
-Vector layers are not effected
-No reprojection envolved (no google maps or any other ref-systems than 
unprojected geographic coordinates)
-GetFeatureInfo - Maxfeatures set to 1
-All testing done at scales where map pixels size was much bigger than 
screen pixel size
-WMS generated by MapServer 5.2.1 based on TIFs created in ArcGIS
-OpenLayers 2.8 -- $Revision: 9492 $

Please have a try on the following code. Any comments are highly 
Kind regards,

<html xmlns="http://www.w3.org/1999/xhtml" debug="false">
<title>TEST </title>

<script src="http://openlayers.org/api/2.8/OpenLayers.js"></script>

<script defer="defer" type="text/javascript">
OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi/?url=";

var sardina = new OpenLayers.Layer.WMS( "Abundancia de larvas de sardina",
{layers: "geo_sardina", styles: '', transparent:true},
{singleTile:true, info_f:'application/vnd.ogc.gml' }
var sst = new OpenLayers.Layer.WMS( "Cambio en temperatura -tiles",
{layers: "temperatura", styles: '', transparent: true}, //maxSST
{singleTile:true, info_f:'application/vnd.ogc.gml', opacity: 0.5}
var sst2 = new OpenLayers.Layer.WMS( "Cambio en temperatura -single tile",
{layers: "temperatura", styles: '', transparent: true}, //maxSST
{info_f:'application/vnd.ogc.gml', opacity: 0.7}
var chl = new OpenLayers.Layer.WMS( "Cambio en clorofila -tiles",
{layers: "clorofila", styles: '', transparent: true}, //meanCHL
{info_f:'application/vnd.ogc.gml', opacity: 0.5}
var chl2 = new OpenLayers.Layer.WMS( "Cambio en clorofila -single tile",
{layers: "clorofila", styles: '', transparent: true}, //meanCHL
{singleTile:true, info_f:'application/vnd.ogc.gml', opacity: 0.7}
var batim = new OpenLayers.Layer.WMS( "Mapa topográfico y batimétría",
{layers: "Bathymetry,Topography,Hillshading,Coastlines,Streams,Rivers"},
{isBaseLayer:true, singleTile:true }

var map;
var lon = -5.85; //W
var lat = 43.65; //N
var zoom = 4; //->1:1.350.000
var xmin = -7.44246; var xmax = -4.1465615625; var ymin = 42.645874375; 
var ymax = 44.84314;
var maxExt = new OpenLayers.Bounds(xmin,ymin,xmax,ymax); /// W, S, O, N

var options = {
controls: [],
fractionalZoom: true,
scales: [20000000, 10000000, 5000000, 2500000, 1350000, 1000000, 750000, 
500000, 250000, 175000, 100000, 50000, 25000, 15000, 10000, 7500, 5000],
projection: 'EPSG:4326'

function init(){
OpenLayers.Util.onImageLoadErrorColor = 'transparent';

map = new OpenLayers.Map('map', options );

map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new OpenLayers.Control.Navigation()); //pan
map.addControl(new OpenLayers.Control.PanZoomBar());
numDigits: 4}));

sst.setVisibility(false); sst2.setVisibility(false);
map.addLayers([batim, sst,sst2,chl,chl2,sardina]);

map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);


<body onload="init()">

<div id="map" ></div>
<div id="coords" ></div>


More information about the Dev mailing list