View Single Post
04/15/14, 04:32 PM   #4
Xrystal
caritas omnia vincit
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2014
Posts: 369
GetMapPlayerPosition has always returned the position of the character in the world.

GetMapName will return the current map's name. If of course the map has been changed it may report a different location to where the player is, which is probably why SetMapToPlayerPosition function was created for.

So far my tests, during my weeks long work at getting pins on the map for my gatherer addon, have been pretty consistent with SetMapToPlayerPosition, GetMapName and GetMapPlayerPosition. Pins I place at those locations stay consistent at those locations regardless of current zoneing. Pins I place on the map using GetUnitZone mess up when zooming.

GetUnitZone is the other zone retrieval function but as it seems you may have found out, this returns a slightly different location zone.

So:
SetMapToPlayerPosition()
mapName = GetMapName()
x,y, heading or z = GetMapPlayerPosition()
  Reply With Quote