# setMapLayerVisible

Immediately mask a layer without restarting active animations, rescaling or reframing. Unknown keys return null.

Canonical: https://chart.syidax.com/docs/methods/setMapLayerVisible/

<a id="definition"></a>

## Definition

```typescript
setMapLayerVisible(layer: GeoMapLayer, visible: boolean): Promise<GeoMapLayerDetail|null>
```

| Arguments | Type | Required |
| --- | --- | --- |
| `layer` | `GeoMapLayer` | Required |
| `visible` | `boolean` | Required |

Return type: `Promise<GeoMapLayerDetail|null>`. Call the method after element registration and await its Promise result.

- [GeoMapLayerDetail](https://chart.syidax.com/docs/types/GeoMapLayerDetail.md) — Type definition
- [GeoMapLayer](https://chart.syidax.com/docs/types/GeoMapLayer.md) — Type definition

<a id="related"></a>

## Related charts

- [sy-geo-map](https://chart.syidax.com/docs/components/geo-map.md#method-setMapLayerVisible)
- [sy-flow-lines](https://chart.syidax.com/docs/components/flow-lines.md#method-setMapLayerVisible)
