4

I have been developing web gis application that requires around 45 different layers served from GeoServer. I had created OpenLayers WMS layers and added them to GeoExt, everything works fine till the 35th layer after I add 36th layer then OpenLayersgives pink tiles. Here is my snippet:

 WGS84 = new OpenLayers.Projection("EPSG:4326");
             WGS84_google_mercator = new OpenLayers.Projection("EPSG:900913");

             map = new OpenLayers.Map({
                 height: '300px',
                 // allOverlays:true,
                 width: '500px',
                 projection: WGS84_google_mercator, displayProjection: WGS84,
                 maxExtent: new OpenLayers.Bounds(80.0509262084961, 26.348379135131836, 88.20467376708984, 30.4458065032959).transform(new OpenLayers.Projection("EPSG:4326"), WGS84_google_mercator),
                 //  )
                 controls: [
        new OpenLayers.Control.Navigation(),
        new OpenLayers.Control.ArgParser(),
        new OpenLayers.Control.Attribution()
                 ]
             });
nnt_dyear_child_layer=new OpenLayers.Layer.WMS("Child Death Rate Yearly",
                         "hostname1/geoserver/wms", {
                             name: 'nnt_indicator_d',
                             layers: "vpdms:nnt_dyear-child", transparent: true,
                             //viewparams: a,
                         }, {
                             layerid: 'nnt_dyear-child_layer',
                             singleTile: true,
                             visibility: false,
                             group: "Indicators/NNT"
                         });
 nnt_dweek_child_layer=new OpenLayers.Layer.WMS("Child Death Rate Weekly",
                         "hostname1/geoserver/wms", {
                             name: 'nnt_indicator_d',
                             layers: "vpdms:nnt_dweek-child", transparent: true,
                             //viewparams: a,
                         }, {
                             layerid: 'nnt_dweek-child_layer',
                             singleTile: true,
                             visibility: false,
                             group: "Indicators/NNT"
                         });
map.addLayers([nnt_dweek_child_layer,nnt_dyear_child_layer]);



and finally  a geoext tree to hold the layer list:
tree1 = new GeoExt.ux.tree.LayerTreeBuilder({
                 region: "west",
                // title: "Layers",
                 renderTo: 'layers',
                 width: 240,
                 height:200,
                 autoScroll: true,
                 rootVisible: false,
                 lines: false,
                 enableDD :true,
                 // widget custom properties
                 wmsLegendNodes: true,
                 vectorLegendNodes: true
             });

I have used google base layers. I'm using openlayers 2.11 and geoext 2 Btw I have already read Here and Official Here Any help would be great.

2

As stated here:

The limit is about 75. After that, layers can appear above popups. This has to do with the z-index in CSS (determines what is 'above' what). Layers (overlay) start at a z-index of 325. Popups start at 750. Controls start at 1000.

Every layer 'takes up' about 5 indexes, so it will reach it's limit at around 75 layers. You cannot have more than 250 popups for the same reason.

If you need more than 75 layers, consider destroying the ones you don't show instead of hiding them and recreate them when needed.

So, your problem must be in the 36th layer. Perhaps, you need to do first a geometry validation for that layer. (Or maybe it has a different EPSG).

  • No all the layers are in the same projection and if i remove the 30 th layer and add 36 (ie total being 35 the problem doesnot occur ) but if i add new 37 th layer the pink tiles appear. – Bishrant Feb 3 '14 at 11:18
  • 1
    Well, there must be a clue in the GeoServer log. Please, check the error message when pink tiles appear. – Sorin Călinică Feb 3 '14 at 12:00
  • 1
    Please post this as an answer. – neogeomat Feb 8 '14 at 5:33
  • 1
    Thanks Sorin, Really looking into the geoserver helped me to find it's solution, the source of problem was geoserver not openlayers. The error is Geoserver Full head error !. Increased headerBufferSize as mentioned in Hereand it works like charm again. – Bishrant Feb 8 '14 at 10:37
  • You are more than welcome, I'm glad I could help, and please remember, any time you have GeoServer problems there must be a clue inside its log! – Sorin Călinică Feb 8 '14 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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