LibMapData-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.

API Documentation

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

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of BNSSNB BNSSNB May 19, 2013 at 04:34 UTC - 0 likes

    library.lua 2163 line last less comma ","

  • Avatar of kagaro kagaro May 18, 2013 at 19:57 UTC - 0 likes

    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.

  • Avatar of omega1970 omega1970 Mar 16, 2013 at 12:50 UTC - 0 likes

    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.

  • Avatar of myrroddin myrroddin Oct 23, 2012 at 00:55 UTC - 0 likes

    And fixed Revision with r121, sorry about that people.

  • Avatar of myrroddin 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.

  • Avatar of myrroddin myrroddin Oct 22, 2012 at 14:07 UTC - 0 likes

    You have a typo on line 38 in r118.

    local worlMapHeight = 31809.64857610083
    

    This should be

    local worldMapHeight = 31809.64857610083
    

    You missed the "d" in "world".

  • Avatar of kagaro kagaro Oct 18, 2012 at 19:37 UTC - 1 like

    Fixed, forgot to check the map flag in the dbc files

  • Avatar of Cortello Cortello Oct 16, 2012 at 23:09 UTC - 0 likes

    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:

    • Kezan 1352.087 x 900 yards
    • The Lost Isles 4514.58 x 3010.417 yards

    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?

    Last edited Oct 17, 2012 by Cortello
  • Avatar of Lombra Lombra Aug 08, 2012 at 17:57 UTC - 0 likes

    @Cortello: Go

    The .toc is there for when you install it standalone. Just ignore it if you're embedding it into your addon. And I think the real addon name is that of the main folder, not what's specified as the title in the ToC file.

  • Avatar of Cortello Cortello Aug 07, 2012 at 23:32 UTC - 0 likes

    Firstly, your example for RegisterCallback in the notes needs a closing parenthesis after the end.

    Secondly, I wonder if you can explain where this module is intended to be installed? The obvious way is to put it in a Libs directory within my module, but if that is the intention why does it have a .toc file? If it was installed like any other module then I could initialise with

    ..\LibMapData-1.0\library.lua
    

    in my own .toc file, but because the module name "Lib: MapData-1.0" has a space there is no way to add it as a dependency to my module. I presume this is deliberate, so what is the intention?

    Last edited Aug 07, 2012 by Cortello

Facts

Date created
May 30, 2010
Categories
Last update
Sep 12, 2013
Development stage
Release
Language
  • enUS
License
All Rights Reserved
Curse link
LibMapData-1.0
Reverse relationships
1
Downloads
154,598
Recent files
  • A: r141 for 5.4.0 Sep 12, 2013
  • A: r140 for 5.4.0 Sep 12, 2013
  • R: 0.30-release for 5.4.0 Sep 10, 2013
  • A: r138 for 5.4.0 Sep 10, 2013
  • A: r137 for 5.3.0 Jul 07, 2013

Authors

Relationships

Tool used
DataTools
Embedded library
CallbackHandler-1.0
LibStub