CLOSE WORLD MAP

Supposed to fire whenever the world map is closed/hidden, though it doesn't. A workaround for this is to use "WORLD_MAP_UPDATE" to set a global variable to use elsewhere with an OnUpdate function; e.g.
 "CLOSE_WORLD_MAP"
 local Map_Changed = false;
 
 function MyAddon_OnEvent()
 if ( (event == "WORLD_MAP_UPDATE") and WorldMapFrame:IsVisible() ) then
 Map_Changed = true;
 end
 end
 
 function MyAddon_OnUpdate()
 if ( (Map_Changed) and not WorldMapFrame:IsVisible() ) then
 ...do this...
 Map_Changed = false;
 end
 end
When the second function is called, it checks to see if the map has been opened/closed (Map_Changed), then checks to see if the map is currently open (WorldMapFrame).
The effect is a code that executes only when the map closes.
Category:API events/Unformatted