Adding and removing controls
OpenLayers offers a great number of controls, commonly used on mapping applications.
This recipe shows how to use the most common controls that have a visual representation. The list includes the OverviewMap control, the Scale and ScaleLine controls, the Graticule control, the LayerSwitcher control, the PanZoomBar control, the MousePosition control, and the Permalink control:
How to do it...
First add the code for the buttons:
<button data-dojo-type="dijit.form.ToggleButton" data-dojo-props="iconClass:'dijitCheckBoxIcon', checked: true, onChange: layerSwitcherChanged">LayerSwitcher</button> <button data-dojo-type="dijit.form.ToggleButton" data-dojo-props="iconClass:'dijitCheckBoxIcon', checked: true, onChange: panZoomBarChanged">PanZoomBar</button> <button data-dojo-type="dijit.form.ToggleButton" data-dojo-props="iconClass:'dijitCheckBoxIcon', checked: true, onChange: mousePositionChanged">MousePosition</button> <button data...