AI-generated Key Takeaways
-
Map.setControlVisibility()
allows customization of the visibility of map controls, such as zoom, scale, layer list, map type, fullscreen, and drawing tools. -
Control visibility can be set individually for each control or globally using the
all
parameter, with individual settings overriding the global setting. -
By default, all map controls are visible; setting
all
tofalse
will hide all controls, while setting it totrue
will show all. -
The layer list's visibility is influenced by the presence of layers and can be further customized using the
layerList
parameter.
Returns this ui.Map.
Usage | Returns |
---|---|
Map.setControlVisibility(all, layerList, zoomControl, scaleControl, mapTypeControl, fullscreenControl, drawingToolsControl) | ui.Map |
Argument | Type | Details |
---|---|---|
all | Boolean, optional | Whether to show all controls. False hides all controls; true shows all controls. Overridden by individually set parameters. Note that setting this explicitly will affect any additional controls added in the future. |
layerList | Boolean, optional | When false, hides the layer list panel or, when true, allows the layer list panel's visibility to be determined by the presence of layers in the list. The default is to show the list. |
zoomControl | Boolean, optional | Whether the zoom control is visible. Defaults to true. |
scaleControl | Boolean, optional | Whether to show the control which indicates the scale at the map's current zoom level. Defaults to true. |
mapTypeControl | Boolean, optional | Whether to show the control that allows the user to change the base map. Defaults to true. |
fullscreenControl | Boolean, optional | Whether to show the control that allows the user to make the map full-screen. Defaults to true. |
drawingToolsControl | Boolean, optional | Whether to show the control that allows the user to add or edit the geometry drawing tools. Defaults to true. |