[OpenLayers-Users] OSM base layer + WMS overlay

François Van Der Biest francois.vanderbiest at camptocamp.com
Thu Feb 23 09:41:43 EST 2012


Hi guys,

This very simple code used to work :

map = new OpenLayers.Map({
    layers: [new OpenLayers.Layer.OSM()]
});
map.addLayers([
    new OpenLayers.Layer.WMS("test", "/geoserver/wms", {
        layers: "dept"
    }, {
        isBaseLayer: false
    })
]);

It does not anymore : the result is a WMS layer whose div is empty.

To fix it, I've had to set the map maxExtent to new OpenLayers.Bounds(
    -128 * 156543.03390625,
    -128 * 156543.03390625,
    128 * 156543.03390625,
    128 * 156543.03390625
)

I find it redundant, since this maxExtent is already defined in
OpenLayers.Layer.XYZ (which is extended by OpenLayers.Layer.OSM).
Am I doing something wrong or is it a bug ?

Thanks,
F.
-- 
Camptocamp France SAS, Chambéry
http://www.camptocamp.com/fr/geospatial-solutions


More information about the Users mailing list