---
title: "showHideLayersByType()"
canonical: "https://onesaitplatform.refined.site/space/DOCT/2220801486/showHideLayersByType()"
format: markdown
---
> ℹ️ **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

```javascript
showHideLayersByType(
	showProperty, 
	layerType
)
```

# Input parameters

## showProperty

<span style="color: #091e42">parameter collecting whether you want to show or hide the layers. This parameter is entered as a text string, and can be:</span>

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

## layerType

<span style="color: #091e42">Parameter that includes the type of layers </span><span style="color: #091e42">whose visibility </span><span style="color: #091e42">you want to modify. This parameter is also entered as a text string, and accepts one of the following options:</span>

1. <span style="color: #003366">**all**</span>: to consider all types of layers.
2. <span style="color: #003366">**dataSources**</span>: to modify only the entities contained in dataSources.
3. <span style="color: #003366">**entities**</span>: to modify only the entities contained in the viewer and outside a dataSource.
4. <span style="color: #003366">**heatmaps**</span>: to modify only heat maps.
5. <span style="color: #003366">**primitives**</span>: to modify only the primitives contained in the viewer's scene.

# Use examples

<span style="color: #091e42">Hide all types of layers present on the map:</span>

```javascript
showHideLayersByType(
    'hide',
    'all'
)
```

<span style="color: #091e42">Show all types of layers present on the map:</span>

```javascript
showHideLayersByType(
    'hide',
    'all'
)
```

![image](media://85dd3a81-6370-42c3-87f8-5bea9d770844)

> ℹ️ **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'
)
```

![image](media://4e2ea6b2-7eeb-47b6-9bad-c6e9caf75e0e)