API C Map.GetBestMapForUnit

Returns the current UI map for the given unit. Only works for the player and party members. uiMapID = C_Map.GetBestMapForUnit(unitToken)

Arguments

 * unitToken : string - UnitId

Returns

 * uiMapID : number ? - Returns the "lowest" UiMapID the unit is on. For example, if a unit is in a microdungeon it will return that instead of the zone or continent map. Between the events PLAYER_LEAVING_WORLD and ZONE_CHANGED_NEW_AREA, this returns nil.

Example
Prints the current map for the player.