---
name: "BIS_fnc_shakeMapEH"
type: function
status: ok
groups: ["Map and Markers", "Event Handlers"]
arma3_since: "1.78"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_shakeMapEH
revid: 379573
updated: 2026-10-31T14:01:25Z
---

# BIS_fnc_shakeMapEH

*Function · Map and Markers, Event Handlers · Arma 3 v1.78*

## Description

Event handler function of [BIS_fnc_shakeMap](../functions/BIS_fnc_shakeMap.md). [BIS_fnc_shakeMap](../functions/BIS_fnc_shakeMap.md) adds it as a "Draw" [event handler](../topics/User_Interface_Event_Handlers.md) to the main map control (display 12, control 51), so it runs every frame the map is drawn.
While the shake lasts, it moves the map view to a random point within *magnitude* metres of the shake center on both axes; the movement fades out during the last quarter of the duration. When the duration has elapsed, it removes the event handler whose ID is stored in the *BIS_shakeMapEventId* variable of [missionNamespace](../commands/missionNamespace.md).
It is meant for internal use; use [BIS_fnc_shakeMap](../functions/BIS_fnc_shakeMap.md) to shake the map.

## Syntax

```sqf
[duration, magnitude, center, startTime] call BIS_fnc_shakeMapEH
```

**Parameters:**

- `duration`: [Number](../topics/Number.md) - (Optional, default 2) duration of the shake in seconds
- `magnitude`: [Number](../topics/Number.md) - (Optional, default 20) maximum offset of the map view, in metres
- `center`: [Array](../topics/Array.md) format [Position](../topics/Position.md) - (Optional, default [0,0,0]) position around which the map shakes
- `startTime`: [Number](../topics/Number.md) - (Optional, default 0) [time](../commands/time.md) at which the shake started

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

How [BIS_fnc_shakeMap](../functions/BIS_fnc_shakeMap.md) adds the handler:

```sqf
private _map = findDisplay 12 displayCtrl 51;
private _code = format ["[%1, %2, %3, %4] call BIS_fnc_shakeMapEH", 2, 20, getPosWorld player, time];
BIS_shakeMapEventId = _map ctrlAddEventHandler ["Draw", _code];
```

## See also

[BIS_fnc_shakeMap](../functions/BIS_fnc_shakeMap.md) · [ctrlMapAnimAdd](../commands/ctrlMapAnimAdd.md) · [ctrlAddEventHandler](../commands/ctrlAddEventHandler.md)

<sub>Source: [BI Community Wiki — BIS fnc shakeMapEH](https://community.bistudio.com/wiki/BIS_fnc_shakeMapEH) (revision 379573).</sub>
