---
description: API for creating and setting water surface features.
---

# JSFlood

> Created with the Module.getFlood API.

```javascript
var flood = Module.getFlood();
```

### active(active)

> Sets the water surface to active or inactive.

{% tabs %}
{% tab title="Information" %}
| Name   | Type    | Description                                                          |
| ------ | ------- | -------------------------------------------------------------------- |
| active | boolean | Sets the water surface to active (true: activate, false: deactivate) |

* Sample
  * Refer to function init.
  * [Sandbox\_Flood](https://sandbox.egiscloud.com/code/main.do?id=weather_flood)
{% endtab %}

{% tab title="Template" %}
```javascript
```
{% endtab %}
{% endtabs %}

### setColor(color)

> Sets the color of the water surface.

{% tabs %}
{% tab title="Information" %}
| Name  | Type                       | Description         |
| ----- | -------------------------- | ------------------- |
| color | [JSColor](../core/jscolor) | Water surface color |

* Sample
  * Refer to function SetFloodColor.
  * [Sandbox\_Flood](https://sandbox.egiscloud.com/code/main.do?id=weather_flood)
{% endtab %}

{% tab title="Template" %}
```javascript
```
{% endtab %}
{% endtabs %}

### setHeight(height)

> Sets the reference height for the water surface.

{% tabs %}
{% tab title="Information" %}
| Name   | Type   | Description                                                            |
| ------ | ------ | ---------------------------------------------------------------------- |
| height | number | Reference height for the water surface (based on sea level, in meters) |

* Sample
  * Refer to function setFloodHeight.
  * [Sandbox\_Flood](https://sandbox.egiscloud.com/code/main.do?id=weather_flood)
{% endtab %}

{% tab title="Template" %}
```javascript
```
{% endtab %}
{% endtabs %}

### setVisibleAltitude(altitude)

> Sets the visible distance for the water surface representation.
>
> The higher the number, the water surface is visible from a farther distance.

{% tabs %}
{% tab title="Information" %}
| Name     | Type   | Description                                        |
| -------- | ------ | -------------------------------------------------- |
| altitude | number | Visible distance for the water surface (in meters) |

* Sample
  * Refer to function setFloodVisibleAltitude.
  * [Sandbox\_Flood](https://sandbox.egiscloud.com/code/main.do?id=weather_flood)
{% endtab %}

{% tab title="Template" %}
```javascript
```
{% endtab %}
{% endtabs %}

### setWaterSpeed(speed)

> Sets the flow speed of the water surface.
>
> The higher the number, the faster the flow speed.

{% tabs %}
{% tab title="Information" %}
| Name  | Type   | Description              |
| ----- | ------ | ------------------------ |
| speed | number | Water surface flow speed |

* Sample
  * Refer to function SetWaterSpeed.
  * [Sandbox\_Flood](https://sandbox.egiscloud.com/code/main.do?id=weather_flood)
{% endtab %}

{% tab title="Template" %}
```javascript
```
{% endtab %}
{% endtabs %}

### visibleWaterPlane(type)

> Sets the visibility of the water surface on the screen.

{% tabs %}
{% tab title="Information" %}
| Name | Type    | Description                                           |
| ---- | ------- | ----------------------------------------------------- |
| type | boolean | Water surface visualization (true: show, false: hide) |

* Sample
  * Refer to function visibleWaterPlane.
  * [Sandbox\_Flood](https://sandbox.egiscloud.com/code/main.do?id=weather_flood)
{% endtab %}

{% tab title="Template" %}
```javascript
```
{% endtab %}
{% endtabs %}
