{"name":"visibleMap","operator":null,"title":"visibleMap","type":"command","url":"https://community.bistudio.com/wiki/visibleMap","revid":376117,"updated":"2025-08-30T17:58:07Z","groups":["Map","Interaction"],"status":"ok","replaced_by":[],"games":[{"game":"arma2","name":"Arma 2","version":"1.00"},{"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.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":null,"effect":null,"server_exec":false},"exec":null,"description":"Return true if the main map is shown (active). In Arma 3 it also returns true if the respawn screen map is visible.","syntaxes":[{"syntax":"visibleMap","since":null,"effect":null,"exec":null,"params":[],"returns":{"type":"Boolean","types":["Boolean"],"description":null,"text":"Boolean"},"form":"nullary","operator":null,"left":null,"right":null}],"examples":[{"text":"```sqf\nif (visibleMap) then { hint \"You're showing the map !\" };\n```","code":["if (visibleMap) then { hint \"You're showing the map !\" };"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["forceMap","openMap"],"notes":[{"user":"3.JgKp James","date":"2017-11-13T15:14:00Z","text":"visibleMap does not work in all cases where a map might be part of a dialog like in a uav terminal or in a artillery computer dialog.\nSome of these cases can be covered with an addMissionEventHandler of type \"Map\".\nJust use the two magic variables 'mapIsOpened' and 'mapIsForced'. Skeleton might look something like:\n\n```sqf\n// update marker as long as map is open (works for UAV stations as well)\nJ_myGPSEH = addMissionEventHandler [\"Map\", {\n\n    params [\"_mapIsOpened\", \"_mapIsForced\"];\n\n    if (_mapIsOpened) then\n    {\n        systemChat \"GPS active\";\n        J_var_GPSOn = true;\n\n        // no sheduled environment -> create one\n        /* Triggered when map is opened or closed either by user action or script command openMap. */\n        0 spawn {\n            waitUntil { \n                // ... // do something as long as map is open\n                not J_var_GPSOn;\n            };\n        };\n    }\n    else\n    {\n        J_var_GPSOn = false;\n        systemChat \"GPS inactive\";\n    };\n}];\n```"}],"categories":["Arma 2: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Interaction","Command Group: Map","Introduced with Arma 2 version 1.00","Scripting Commands","Take On Helicopters: Scripting Commands"]}