Thread Tools Display Modes
07-24-18, 08:56 AM   #1
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
C_Map.GetMapPosFromWorldPos

The usage for C_Map.GetMapPosFromWorldPos is:
Usage: local uiMapID, mapPosition = C_Map.GetMapPosFromWorldPos(continentID, worldPosition [, overrideUiMapID])

The in-game /api documentation is:

function C_Map.GetMapPosFromWorldPos(continentID, worldPosition, optional overrideUiMapID)
Arguments:
1. number continentID
2. table worldPosition
3. (optional) number overrideUiMapID
Returns
1. number uiMapID
2. table mapPosition

My question is: what is continentID? Is that the uiMapID of the continent? Some new numbering system? Can it be inferred from a uiMapID?

I'm trying to translate the returns of a UnitPosition (which can be on a different continent than the player is in; these are saved world positions) to map positions, and was hoping to use this.

edit: Actually, it appears the first argument should be the fourth return of UnitPosition. Or at least, they appear to translate to roughly the right numbers.

Last edited by Gello : 07-24-18 at 10:07 AM.
  Reply With Quote
07-24-18, 12:19 PM   #2
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
The "continentID" is what I would normally refer to as the instance ID, and it represents the instance that the coordinate plane belongs to (eg. kalimdor, ragefire chasm, etc).

It's the same value that has been historically returned by GetInstanceInfo and UnitPosition.

Something very important to note is that the X and Y axes from world coordinates are rotated 90 degrees from the world map's north/south/east/west, so if you're translating between the two you need to remember that X represents north to south, and Y represents east to west.

Last edited by semlar : 07-24-18 at 12:25 PM.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » C_Map.GetMapPosFromWorldPos

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off