---
title: "showHideLayerByName()"
canonical: "https://onesaitplatform.refined.site/space/DOCT/2220801444/showHideLayerByName()"
format: markdown
---
> ℹ️ **Information**
> ℹ️ 
> ℹ️ Implementation version: beta 1.02

# Description

Shows or hides a map layer, given its name.

# Invocation

```javascript
showHideLayerByName(
	showProperty,
	layerName
)
```

# Input parameters

## showProperty

Parameter that specifies whether you want to show or hide the layer. It is a text string that accepts one of these two possibilities:

1. **showLayer**: to show the layer.
2. **hideLayer**: to hide the layer.

## layerName

<span style="color: #091e42">The name of the layer from which the dataSource will be selected. This name corresponds to the name of the entity collection (featureCollection.name). It is entered as a text string.</span>

# Use examples

Hide a layer that's named 'points single':

```javascript
showHideLayerByName(
	'hideLayer',
	'points single'
)
```


Show that same layer again:

```javascript
showHideLayerByName(
	'showLayer',
	'points single'
)
```

![image](media://500f2d33-8b67-4c58-90f6-c12ab0e22f51)

> ❌ El ejemplo visual se realizó en una versión previa, por lo que utiliza "show" y "hide" en vez de las cadenas de texto correctas de "showLayer" y "hideLayer".