{"name":"visibleMap","title":"visibleMap","type":"command","url":"https://community.bistudio.com/wiki/visibleMap","revid":376117,"updated":"2025-08-30T17:58:07Z","groups":["Map","Interaction"],"status":"ok","games":{"arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma2 1.00","arma3_since":"0.50","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","params":[],"returns":{"type":"Boolean","type_expr":"Boolean"},"form":"nullary"}],"examples":[{"code":["if (visibleMap) then { hint \"You're showing the map !\" };"]}],"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```"}]}