======================================================= MapServer interaction: layer control ======================================================= - Author: bukun - Update: 2022-10-7 How to control layers ======================================================= 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 is the corresponding Mapfile: .. literalinclude:: ./mfu3.map :lineno-start: 1 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: ::
Layer control form
Open and close map layers =================================================== The demo could be opened directly via the following link: :: Open layer control page
The following shows a form submission, and various parameters are passed through the hidden `input` control. The effect is the same as aboveļ¼š ::
Layer control form