[OpenLayers-Users] Units of BBOX in a WMS request

Tom B seileef at gmail.com
Thu Apr 30 17:23:49 EDT 2009


Hi,

I'm making WMS requests to GeoServer, with the map and layer options listed
below, but the BBOX values in the requests are sent in degrees, instead of
meters.  I'm a bit new to OpenLayers and feel like I might be missing
something simple.

In case it's relevant, the .units property of both the map and the WMS layer
object are indeed "m" at runtime.  Running .projection.getUnits() on the
layer object returns null, but from a quick look at the OL lib, that looked
like it wouldn't be a problem.  The layer object's .projection value is set
to EPSG:900913.

Any ideas on how to get the BBOX value into meters?

The parameters sent look like this: 
LAYERS=layer%3Atest&TRANSPARENT=true&SRS=EPSG%3A900913&PROJECTION=EPSG%3A900913&UNITS=m&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&FORMAT=image%2Fpng&BBOX=46.66000000014901,1.6600000001490116,91.66000000014901,46.66000000014901&WIDTH=256&HEIGHT=256

new OpenLayers.Layer.WMS("", wms_service + "/wms", {
	layers: layer_name,
	transparent: true,
	projection: new OpenLayers.Projection("EPSG:900913"),
	units: "m"				
}

new OpenLayers.Map('map', {
	controls: [],
	projection: new OpenLayers.Projection("EPSG:900913"),
	units: "m",
	maxResolution: 156543.0339,
	maxExtent: new OpenLayers.Bounds(-20037508.34, -20037508.34, 20037508.34,
20037508.34)
});

Thanks,
Tom
-- 
View this message in context: http://n2.nabble.com/Units-of-BBOX-in-a-WMS-request-tp2750178p2750178.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list