[OpenLayers-Users] How to control the WMS tile origins?

Paul kennedy P.Kennedy at fugro.com.au
Mon May 31 20:20:11 EDT 2010


Hi
Apologies, this is a repost, as the forum continues to say my original is
'pending'. 
I have been trying to figure this out for 2days and it is driving me nuts. 
I have a wms server which has hard bounds of -180,-90 to 180,90, ie I cannot
make requests beyond e end of the world!

I can see the data in openlayers if I use single tile, but I am having
trouble with tiled requests.  The tile origins are not at even spacings from
the origin.  I would have thought the low resolution requests would be at 90
degree tile spacings, but they are about 92 degrees.  By the time we get
across the globe, the last tile is asking for data at 188 degrees long, when
it should be adhering to my layer and map bound of 180.0

Is there any way I can control the origin and tile size, so I can force
openlayers to always ask for consistent tile origins?

here is my code...

            var enc_wms = new OpenLayers.Layer.WMS(
					"ENC WMS", "http://172.23.21.4/WMS/wms.ashx",
                    {
						layers: 'ENC' , 
						//Width: '256',
						//Height: '256',
						//tilesOrigin: "-180.0, -90.0" ,
						//tiled: 'true' , 
						srs: 'EPSG:4326',
						styles: ' ',
						format: 'image/png',
					},
					
					{	
						//wrapDateLine: true,
						//buffer: 0,
						maxResolution: 1.40625,
						//minExtent: new OpenLayers.Bounds(-180, -90, 180, 90),
						//maxExtent:[-180,-90,180,90],
						maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90),
						resolutions:[1.40625,0.703125,
0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0.00004291534423828125,0.000021457672119140625],
						displayOutsideMaxExtents: false,
						isBaseLayer: false, 
						transitionEffect: 'resize', 
						//ratio: 1 
					});

As you can see from the image, the lower left corner of the tile is NOT at a
predictable origin, whihc in this case should be 90W.
http://osgeo-org.1803224.n2.nabble.com/file/n5123935/wmstiletroubles.png 


Many thanks in advance.
http://osgeo-org.1803224.n2.nabble.com/file/n5123935/wmstiletroubles.png 
-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/How-to-control-the-WMS-tile-origins-tp5123935p5123935.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list