{"name":"mapCenterOnCamera","operator":null,"title":"mapCenterOnCamera","type":"command","url":"https://community.bistudio.com/wiki/mapCenterOnCamera","revid":377461,"updated":"2026-01-02T06:47:30Z","groups":["GUI Control - Map"],"status":"ok","replaced_by":[],"games":[{"game":"arma2","name":"Arma 2","version":"1.02"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma2","name":"Arma 2","version":"1.02"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"The main syntax enables/disables continuous centering of the main map type control on the camera position. Needs to be executed once.\n\nThe alternative syntax centers mini map type control on camera. Needs to be executed each frame (preferably inside an `onDraw` event handler).","syntaxes":[{"syntax":"mainmap mapCenterOnCamera enable","since":null,"effect":null,"exec":null,"params":[{"name":"mainmap","type":"Control","optional":false,"default":null,"description":null,"types":["Control"],"since":null,"text":"mainmap: Control"},{"name":"enable","type":"Boolean","optional":false,"default":null,"description":null,"types":["Boolean"],"since":null,"text":"enable: Boolean"}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"mainmap","types":["Control"]},"right":{"text":"enable","types":["Boolean"]}},{"syntax":"mapCenterOnCamera minimap","since":"arma3 1.48","effect":null,"exec":null,"params":[{"name":"minimap","type":"Control","optional":false,"default":null,"description":null,"types":["Control"],"since":null,"text":"minimap: Control"}],"returns":{"type":null,"types":["PositionASL","getPosWorld"],"description":null,"text":"PositionASL of the map center (camera focus object's **model centre**'s position (see getPosWorld)) in render scope"},"form":"unary","operator":null,"left":null,"right":{"text":"minimap","types":["Control"]}}],"examples":[{"text":"```sqf\n// --- Minimap update\n((uiNamespace getVariable \"BIS_UAV_DISPLAY\") displayCtrl 112410) mapCenterOnCamera true;\n```","code":["// --- Minimap update\n((uiNamespace getVariable \"BIS_UAV_DISPLAY\") displayCtrl 112410) mapCenterOnCamera true;"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["ctrlMapAnimAdd","ctrlMapAnimCommit","getPosWorld"],"notes":[],"categories":["Arma 2: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: GUI Control - Map","Introduced with Arma 2 version 1.02","Scripting Commands","Take On Helicopters: Scripting Commands"]}