---
name: "mapCenterOnCamera"
type: command
status: ok
groups: ["GUI Control - Map"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/mapCenterOnCamera
revid: 377461
updated: 2026-01-02T06:47:30Z
---

# mapCenterOnCamera

*Command · GUI Control - Map · Arma 3 v0.50 · introduced in Arma 2 v1.02*

## Description

The main syntax enables/disables continuous centering of the main map type control on the camera position. Needs to be executed once.

The alternative syntax centers mini map type control on camera. Needs to be executed each frame (preferably inside an `onDraw` event handler).

## Syntax

### Syntax 1

```sqf
mainmap mapCenterOnCamera enable
```

**Parameters:**

- `mainmap`: [Control](../topics/Control.md)
- `enable`: [Boolean](../topics/Boolean.md)

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

### Syntax 2

*since arma3 1.48*

```sqf
mapCenterOnCamera minimap
```

**Parameters:**

- `minimap`: [Control](../topics/Control.md)

**Returns:** [PositionASL](../topics/Position.md#positionasl) of the map center (camera focus object's **model centre**'s position (see [getPosWorld](../commands/getPosWorld.md))) in render scope

## Examples

### Example 1

```sqf
// --- Minimap update
((uiNamespace getVariable "BIS_UAV_DISPLAY") displayCtrl 112410) mapCenterOnCamera true;
```

## See also

[ctrlMapAnimAdd](../commands/ctrlMapAnimAdd.md) · [ctrlMapAnimCommit](../commands/ctrlMapAnimCommit.md) · [getPosWorld](../commands/getPosWorld.md)

<sub>Source: [BI Community Wiki — mapCenterOnCamera](https://community.bistudio.com/wiki/mapCenterOnCamera) (revision 377461).</sub>
