showHideLayersByType()

Information

Implementation version: beta 1.01

Updated in: beta 1.09

Description

Shows or hides all the layers of a particular type, or of all the types.

Invocation

showHideLayersByType(
	showProperty, 
	layerType
)

Input parameters

showProperty

parameter collecting whether you want to show or hide the layers. This parameter is entered as a text string, and can be:

  1. show: to show the layers of that type.
  2. hide: to hide the layers of that type.

layerType

Parameter that includes the type of layers whose visibility you want to modify. This parameter is also entered as a text string, and accepts one of the following options:

  1. all: to consider all types of layers.
  2. dataSources: to modify only the entities contained in dataSources.
  3. entities: to modify only the entities contained in the viewer and outside a dataSource.
  4. heatmaps: to modify only heat maps.
  5. primitives: to modify only the primitives contained in the viewer's scene.

Use examples

Hide all types of layers present on the map:

showHideLayersByType(
    'hide',
    'all'
)

Show all types of layers present on the map:

showHideLayersByType(
    'hide',
    'all'
)

Examples symbology

City icons (aquamarine color) are entities contained in a dataSource; red dots are primitive; and the purple image corresponds to a heat map.

Hide only entity dataSources:

showHideLayersByType(
	'hide',
	'dataSources'
)


Show only entity dataSources:

showHideLayersByType(
	'show',
	'dataSources'
)