Map.setControlVisibility

  • Map.setControlVisibility sets the visibility of controls on the map and returns the ui.Map object.

  • Arguments allow for controlling the visibility of all controls, the layer list, zoom, scale, map type, fullscreen, and drawing tools controls individually or collectively.

  • The all argument can show or hide all controls but is overridden by individual settings and affects future controls.

  • Default settings generally show zoom, scale, map type, and fullscreen controls, while the layer list depends on the presence of layers, and drawing tools default to being visible.

Sets the visibility of the controls on the map.

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.
Create a Mobile Website
View Site in Mobile | Classic
Share by: