What does STATUS mean in a LAYER?
Up to table of contentsWhy are there three possible values for STATUS in a LAYER, and what do they mean?
- STATUS ON really means "STATUS available-if-requested"
-
This FAQ applies to: Any version.
clarification for map mode of CGI interface
Posted by
Nathan Vander Wilt
at
2007-10-17 15:13
From Steve Lime on [UMN_MAPSERVER-USERS]:
[The CGI] turns everything off that is not "STATUS DEFAULT" off so all layers start from the same state (e.g. off) and must be explicitly requested to be drawn or query. That common state made (at least in my mind) implementations easier. I mean, if a layer "lakes" started ON the doing layer=lakes would turn it OFF. So I wanted to remove the ambiguity of a starting state.
So, from the CGI point of view if it's not a default layer then consider it off and you must request it.
[The CGI] turns everything off that is not "STATUS DEFAULT" off so all layers start from the same state (e.g. off) and must be explicitly requested to be drawn or query. That common state made (at least in my mind) implementations easier. I mean, if a layer "lakes" started ON the doing layer=lakes would turn it OFF. So I wanted to remove the ambiguity of a starting state.
So, from the CGI point of view if it's not a default layer then consider it off and you must request it.
To elucidate
STATUS ON and STATUS OFF set the default status of the layer. If a map is requested, those layers will be ON/OFF unless otherwise specified via the layers parameter. This is particularly the case when using Mapscript and Mapserver's built-in template mechanism, but is also useful as a hint when writing your own apps and setting up the initial map view.
STATUS DEFAULT means that the layer is always on, even if not specified in the layers parameter. A layer's status can be changed from DEFAULT to OFF in Mapscript, but other than that, it's always on.