WoWInterface - View Single Post - How to get the size in yards of a given map?
View Single Post
08-18-08, 11:55 AM   #1
Premium Member
Duugu's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 851
How to get the size in yards of a given map?

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:
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.
  Reply With Quote