I'm trying to display a map using OpenLayers through GeoServer's WMS. I'd like to know how OpenLayers calculates the BBOX coordinates to set them properly with js and avoid the posted error response. I haven't this issue with OpenStreetMap and GoogleStreetMap.
This is the JavaScript code I used in my function:
function myfunc(display, url){
var params = {};
params.layers = 'Italy';
params.format = 'image/jpeg';
params.transparent = true;
var options = {};
options.projection='EPSG:900913';
options.displayProjection="EPSG:4326";
options.maxExtent= new OpenLayers.Bounds(-20037508.34, 20037508.34,20037508.34,20037508.34);
options.isBaseLayer = true;
return new OpenLayers.Layer.WMS(display, url, params, options);
}
This is the request to the geoserver:
http://mydomain:myport/geoserver/gwc/service/wms?LAYERS=Italy&FORMAT=image%2Fpng&TRANSPARENT=true&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A900913&BBOX=1384430.175625,5152466.50375,1384430.87875,5152467.206875&WIDTH=256&HEIGHT=256
This is the response I'm getting from the geoserver:
400: Resolution (0.00274658203125) is not with 5.0% of the closest grid resolution (0.0023326729820109904)