Opened 17 years ago
Last modified 16 years ago
#2301 assigned defect
Mapserver and shp2img have different behaviour for layer's without a NAME
Reported by: | bartvde | Owned by: | sdlime |
---|---|---|---|
Priority: | normal | Milestone: | 5.6 release |
Component: | MapServer CGI | Version: | 5.0 |
Severity: | normal | Keywords: | |
Cc: |
Description
If I omit a NAME from a LAYER, shp2img will still draw the layer, but Mapserver will not draw it using &mode=map&layers=all.
Would it not be better to generate an error/warning message saying the NAME is required in all cases?
Change History (2)
comment:1 by , 17 years ago
Milestone: | FUTURE → 5.2 release |
---|
comment:2 by , 16 years ago
Status: | new → assigned |
---|
Note:
See TracTickets
for help on using tickets.
This issue is not new to 5.0, it's always been like this. It happens because layers=all simply builds a list of all layer names in the mapservObj->Layers[] array in loadForm() as if all layers had been listed explicitly by the caller in the layers parameter. The job of setting the layer status is handled only at a later time in the processing. Unfortunately that doesn't work too well for layers with empty names.
I'm not sure that producing a fatal error if a layer is missing a name is a good idea since layers can also be referred to by group even if they have no name.
At the moment layers with no name are added as "" (empty string) in the Layers[] array by the layers=all option. The fix may be as simple as treating name == NULL and name == "" as being a match in isOn() in maptemplate.c.