Permalink
Browse files

Mark disabled layers as processed to prevent from being displayed in …

…nested groups (#4533)
  • Loading branch information...
1 parent a2aed6a commit 0c94a8de5f57ab90ab9ddade7b8379b3b577c644 @szekerest szekerest committed Mar 3, 2013
Showing with 7 additions and 2 deletions.
  1. +7 −2 mapwms.c
View
@@ -3327,6 +3327,12 @@ int msWMSGetCapabilities(mapObj *map, int nVersion, cgiRequestObj *req, owsReque
/* processed already */
pabLayerProcessed = (char *)msSmallCalloc(map->numlayers, sizeof(char*));
+ /* Mark disabled layers as processed to prevent from being displayed in nested groups (#4533)*/
+ for(i=0; i<map->numlayers; i++) {
+ if (!msIntegerInArray(GET_LAYER(map, i)->index, ows_request->enabled_layers, ows_request->numlayers))
+ pabLayerProcessed[i] = 1;
+ }
+
nestedGroups = (char***)msSmallCalloc(map->numlayers, sizeof(char**));
numNestedGroups = (int*)msSmallCalloc(map->numlayers, sizeof(int));
isUsedInNestedGroup = (int*)msSmallCalloc(map->numlayers, sizeof(int));
@@ -3336,8 +3342,7 @@ int msWMSGetCapabilities(mapObj *map, int nVersion, cgiRequestObj *req, owsReque
layerObj *lp;
lp = (GET_LAYER(map, i));
- if (pabLayerProcessed[i] || (lp->status == MS_DELETE) ||
- (!msIntegerInArray(lp->index, ows_request->enabled_layers, ows_request->numlayers)))
+ if (pabLayerProcessed[i] || (lp->status == MS_DELETE))
continue; /* Layer is hidden or has already been handled */
if (numNestedGroups[i] > 0) {

0 comments on commit 0c94a8d

Please sign in to comment.