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
Facts
- Date created
- May 30, 2010
- Categories
- Last update
- Jul 20, 2016
- Development stage
- Release
- Language
- enUS
- License
- All Rights Reserved
- Curse link
- LibMapData-1.0
- Reverse relationships
- 24
- Downloads
- 172,881
- Recent files
Authors
Relationships
- Tool used
- DataTools
- Embedded library
- CallbackHandler-1.0
- LibStub
- Reply
- #65
Sellenity Jul 16, 2015 at 15:59 UTC - 1 likeno hellfire citadel :( Grid Priest AOE doesnt work!
- Reply
- #64
burny_dd Jun 15, 2015 at 12:45 UTC - 0 likesI'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.
The first rule of Tautology Club is the first rule of Tautology Club.
- Reply
- #63
BNSSNB May 19, 2013 at 04:34 UTC - 0 likeslibrary.lua 2163 line last less comma ","
- Reply
- #62
kagaro May 18, 2013 at 19:57 UTC - 0 likesi 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.
- Reply
- #61
omega1970 Mar 16, 2013 at 12:50 UTC - 0 likesHi 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.
- Reply
- #60
myrroddin Oct 23, 2012 at 00:55 UTC - 0 likesAnd fixed Revision with r121, sorry about that people.
- Reply
- #59
myrroddin Oct 22, 2012 at 23:57 UTC - 0 likes@myrroddin: Go
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.
- Reply
- #58
myrroddin Oct 22, 2012 at 14:07 UTC - 0 likesYou have a typo on line 38 in r118.
This should be
You missed the "d" in "world".
- Reply
- #57
kagaro Oct 18, 2012 at 19:37 UTC - 1 likeFixed, forgot to check the map flag in the dbc files
- Reply
- #56
Cortello Oct 16, 2012 at 23:09 UTC - 0 likesI'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.dbcdata, and Astrolabe appears to have it right:Update
I decided to try changing the LibMapData tables myself, but see that the
mapDatatable 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?