I have created a WMS layer in geoserver. I have added that WMS layer using openlayers and geoext. The WMS layer is displaying, but when I zoom in, the layer disappears and when zoomed out the layer is again visible as a dot.

My code is:

 new OpenLayers.Layer.WMS("Layers",
                   transparent: true,
                    format: "image/png"

                    isBaseLayer: false,

                    buffer: 0,
                    // exclude this layer from layer container nodes
                    displayInLayerSwitcher: false,
                    visibility: false
  • can you tell the zoom level on which the layer disappears? Commented May 13, 2016 at 5:30

1 Answer 1


You can use a maxExtent for your map. In combination with a 3rd-party background-layer this can prevent the problem you described.

var extent = new OpenLayers.Bounds(-2003750.34, -2003750.34, 2003750.34, 2003750.34);

map = new OpenLayers.Map("map", {
        maxExtent: extent
  • Hi thanks for your reply.I have tried your code but i am facing the same problem.
    – user46218
    Commented May 13, 2016 at 16:59
  • Can you post more of your code (especially map initialization and baselayers)?
    – Thomas B
    Commented May 13, 2016 at 17:21
  • Thank you . your code i working fine. before i have added extent inside the layer, so it didnt worked. Now it is working.
    – user46218
    Commented May 13, 2016 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.