Example 2.2: Layer Control
Being able to turn map layers on and off is a standard feature of web mapping applications. There are many ways to accomplish this using form objects as control. You can use the drop box/menu, check boxes, and/or radio buttons. In this example you'll see how to implement layer selection using check boxes and drop boxes.
Here's the mapfile:
Notice how the layer STATUS has been changed to OFF except for the "States" polygon background. The states background was left as default so our map will always have something when drawn without any layers turned on. The users of our application should have control of which layers to turn on or leave off.
You'll understand how the layers are turned on/off by MapServ if you look at the source code of our HTML template.