[OpenLayers-Users] Rounding BBOX?

Per-Olof Norén pelle at alma.nu
Tue Oct 2 09:23:09 EDT 2007


Hi list,

I'm currently part of a project that uses ArcIMS WMSConnector as WMS 
serving a raster base layer to an OpenLayers client. All this is done in 
the projection "RT90 Swedish grid", EPSG:2400. No problems.

OpenLayers is set up with specific scales according to this:

OpenLayers.IMAGE_RELOAD_ATTEMPTS = 2;
var rt90bbox = new OpenLayers.Bounds(1200000, 6100000, 1900000, 7700000);    

var options = {	
	maxExtent: rt90bbox,
	scales: [
		8000000,4000000,2000000, 1000000,500000,250000, 150000,100000,75000,
		50000,25000,20000,15000,12500,10000,5000,2500],		
	units: 'm', 
	projection: "EPSG:2400",
	controls: [new OpenLayers.Control.MouseDefaults()]
};
var map = new OpenLayers.Map("map", options);

var baseLayer1 = new OpenLayers.Layer.WMS("Baselayer",

urls,
{layers: 'sverige' , format:'image/png'},
{isBaseLayer: true, projection: 'EPSG:2400'});

Now, at certain zoom-levels the WMSConnector is apparently doing some 
illegal math and requested tile is generated with a white stripe along 
one or two sides. Same behaviour is seen when the image src that 
Openlayers generates is called directly, so its not that OpenLayers is 
doing something wrong. Its ArcIMS.

The problem seems to go away, at large zoom levels (1:2500) if one 
removes the decimals from the BBOX generated by OpenLayers.

I found this
http://www.nabble.com/Rounding-BBOX-t2383934.html

Is there a way of setting a global or layer specific rounding of BBOX in 
Open Layers 2.4 ?

ps
I'm not in position to either debug or file an ESRI support issue 
regarding this. I'm merely looking for a client-side workaround.
ds


regards,
Per-Olof



More information about the Users mailing list