#827 closed defect (fixed)
Add layers=all for debugging
Reported by: | dmorissette | Owned by: | dmorissette |
---|---|---|---|
Priority: | high | Milestone: | 4.4 release |
Component: | MapServer CGI | Version: | 4.3 |
Severity: | normal | Keywords: | |
Cc: | frank.koormann@…, woodbri@… |
Description
Steve, What would you think of adding the ability to pass "layers=all" to the mapserv CGI to automatically display all layers that have status=on. I've used this hack before to quickly test mapfiles, and others (Steve W.) seem to find it useful as well.
Change History (7)
comment:2 by , 20 years ago
I forgot to add that the former, just a loop somewhere in the main program seems easiest to me... Steve
comment:3 by , 19 years ago
Cc: | added |
---|---|
Owner: | changed from | to
Here is the loop that I had... this was in 3.6, I'll look at integrating into 4.3 now: if(strncasecmp(msObj->ParamNames[i],"layers", 6) == 0) { // turn a set of layers, delimited by spaces, on int num_layers=0, l; char **layers=NULL; /* IF layers=all then enable all layers - Custom hack DM, 20030511 */ if (strcasecmp(msObj->ParamValues[i], "all") == 0 && msObj->Map != NULL) { /* Yes we reset NumLayers and this may result in a small memory leak... no big deal */ for(msObj->NumLayers=0; msObj->NumLayers < msObj->Map->numlayers; msObj->NumLayers++) { if (msObj->Map->layers[msObj->NumLayers].name) { msObj->Layers[msObj->NumLayers] = strdup(msObj->Map->layers[msObj->NumLayers].name); } else { msObj->Layers[msObj->NumLayers] = strdup(""); } } continue; } layers = split(msObj->ParamValues[i], ' ', &(num_layers)); for(l=0; l<num_layers; l++) msObj->Layers[msObj->NumLayers+l] = strdup(layers[l]); msObj->NumLayers += l; msFreeCharArray(layers, num_layers); num_layers = 0; continue; }
comment:4 by , 19 years ago
Status: | new → assigned |
---|
comment:5 by , 19 years ago
Milestone: | → 4.4 release |
---|
comment:6 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Fixed. Implemented in 4.3. Of course I have reorganized the sample code above to not leak memory. Note that this will work only for the mapserv CGI and doesn't do anything for the WMS or MapScript.
comment:7 by , 19 years ago
Cc: | added |
---|
I have updated the cgi-reference.xml with a note about the LAYERS=all shortcut. Adding Frank K. (owner of the cgi-=reference doc) to the CC in case I broke something.
Note:
See TracTickets
for help on using tickets.