Since GetPlayerMapPosition() returns coordinates for instances with WotLK I'm current playing around with the coordinates and range checks.

My goal is to calculate the distance between the player and a specific unit in yards.

I realized that GetPlayerMapPosition() returns "the unit position relative to WorldMapDetailFrame". A number between 0 and 1.

So I used GetPlayerMapPosition() to get PlayerX, PlayerY and TargetX, TargetY.

So far so good. But how do I get the range in yards from this data? I've found the Astrolabe and LibTourist libs. Both calculate distances in yards based on GetPlayerMapPosition and additional tables with the size in yards of all zones.

eg. from Astrolabe:

Code:

Ashenvale = {
height = 3843.722811451077,
width = 5766.728884700476,
...
}

So this is exactly what I need. But where the hell do I get these data from?

I've searched around for hours, did tests with map viewers, mpq data, looked at WorldMapFrame.lua, etc., etc. But I can't find any way to get, query or calculate the map size of a given map in yards.

I would really appreciate any help/idea on this topic.