LibMapData-1.0
Note: LibMapData-1.0 is unmaintained, a suggested replacement library is HereBeDragons-1.0
Small library that provides mapfile data. it include width,height, upper left x,y and lower right x,y. This data includes multi-floor maps such as the new instances.
To get the mapfile names use GetMapInfo() on the current map. Filenames are constant across localizations.
Sample usage:
mapfiles = LibStub("LibMapData-1.0"); -- get the size of Coth defaulting to the first floor size local width,height = mapfiles:MapArea('CoTStratholme') -- get the size of the 8th floor of icc width,height = mapfiles:MapArea('IcecrownCitadel',8) -- get the size of the Arati mapfile. width,height = mapfiles:MapArea('Arathi')
The floors are optional and if a given floor is not found 0,0 will be returned. This lib came about as a result of several addons needing the data, and simply copying and pasting them in each copy occupies around 44k of memory.
LibMapData now supports Mapchanged callback event. Sample usage:
mapfiles = LibStub("LibMapData-1.0"); mapfiles:RegisterCallback("MapChanged",function(event,map,floor,w,h) print("Map is now "..map) end
no hellfire citadel :( Grid Priest AOE doesnt work!
I'm not quite happy with the MapChanged event fired by the library. When you change the zone with the world map open no event is fired which is okay. But when the world map then is closed there is still no event fired and in effect the zone change notification is completely lost.
Also it seems the transition from Shadowmoon Valley to the player garrison sometimes produces (0, 0) as player position GetPlayerMapPosition("player") after the Blizzard ZONE_CHANGED* event and so no event "MapChanged" event is fired by the lib. For my purpose I work around it by checking if LibMapDaty:MapAreaId(mapfile) is valid for the current map instead of checking the player position.
Missing two area id's in mapData.
mapData[1010] = { ['floors'] = 0, ['name'] = "HillsbradFoothillsBG", ['rzti'] = 1280, ['map_type'] = 1, ['continent'] = 0, ['transform'] = 0, [1] = {1822.9169921875,1445.8330078125,-1995.8330078125,2977.0830078125,172.916015625,1531.25}, ['micro'] = {}, }
mapData[1011] = { ['floors'] = 0, ['name'] = "AshranHordeFactionHub", ['rzti'] = 1116, ['map_type'] = 0, ['continent'] = 0, ['transform'] = 0, [1] = {800.0,533.3330078125,3589.583984375,5541.666015625,4389.583984375,5008.3330078125}, ['micro'] = {}, }
Are there any plans to update this for 6.0?
library.lua 2163 line last less comma ","
i just updated the lib with 5.3 data, and for omega1970 ill go double check it, it seems i may have a floor parsing issue when the is a senario and normal map for the same area.
Hi m8,
Getting some strange numbers in Pandara...in the Shrine of the Seven Stars, the range seems to be multiplied by 10.....on the Isle of the Thunder King, range seems to be divided by 10 when using the lib:Distance function.
An update for Throne of Thunder for 5.2 would be nice, tyvm
will be pushed when it goes live im having issues with ptr data being accurate.
Thank you,
Any progress on map for Sha of Fear HM?
ill see if I can extract the data for it. some of those 'phases' arent really maps in game sense but a screen overlay effect and doesnt return x,y for those areas but ill investigate since im working on 5.2 ptr data as well.
Hey, Sha of Fear heroic last phase is missing here, would be nice if you could add it.
And fixed Revision with r121, sorry about that people.
@myrroddin
I did a commit in version r119 that fixes the typo, adds Revision keyword (careful when you commit next time), deleted the hard-embedded Libs folder, and I forgot in the changelog: LibStub now pulls from Trunk rather than a specific version. See LibStub's page for details. I jumped to the appropriate section.
You have a typo on line 38 in r118.
This should be
You missed the "d" in "world".
Fixed, forgot to check the map flag in the dbc files
I'm getting a size of 274 x 183 yards for Kezan and The Lost Isles, which is absolutely tiny - it's a third of the size of Dalaran and I'm pretty certain it's wrong
Astrolabe gives 1352 x 900 yards for Kezan, and 4515 x 3010 yards for The Lost Isles, but that doesn't mean much as the two libraries differ quite widely for all the zones
Am I missing something? Or can this be fixed in LibMapData please?
Update
I have checked the
WorldMapArea.dbc
data, and Astrolabe appears to have it right:Update
I decided to try changing the LibMapData tables myself, but see that the
mapData
table has seven floors for both Kezan and The Lost Isles, and none of those floors have anything like the dimensions I expect. What's going on here please?Message: ..\AddOns\LibMapData-1.0\library.lua line 60:
unexpected symbol near '/'
LouCypher, all fixed, sorry about that i forgot a luac before the tagging.
its fixed now.