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 kagaro kagaro Sep 26, 2010 at 04:00 UTC - 0 likes

    It should be good to use now on live,Ptr and beta I've still got some functions to clean up and update the documentation

  • Avatar of sinepi sinepi Sep 13, 2010 at 18:31 UTC - 0 likes

    Will this library be updated for Cataclysm during Beta, or only after release? I'd like to switch my Astrolabe over to using this library, and I'll either go and start surveying the map sizes and offsets myself (shouldn't be too hard, after all, two coord points per zone remapped to world map = zone size and offset) and post those for you, or just use whatever you have :)

  • Avatar of kagaro kagaro Jul 13, 2010 at 00:43 UTC - 0 likes

    its there, the real map name is NetherStormArena

  • Avatar of kagaro kagaro Jul 13, 2010 at 00:37 UTC - 0 likes

    ill add it in mysticalos

  • Avatar of mysticalos mysticalos Jul 09, 2010 at 21:29 UTC - 0 likes

    missing eye of the storm

    areaID
    483

  • Avatar of kagaro kagaro Jun 06, 2010 at 19:02 UTC - 0 likes

    unless someone find an error, gona tab as release.

  • Avatar of kagaro kagaro Jun 02, 2010 at 20:14 UTC - 0 likes

    Ive added some distance and direction functions as well

  • Avatar of kagaro kagaro Jun 01, 2010 at 14:07 UTC - 0 likes

    may add that olog, right now it does use any events so its 0 cpu just a little memory

  • Avatar of olog olog Jun 01, 2010 at 09:58 UTC - 0 likes

    Having the coordinates in a library is very useful in itself already but what's often needed with them is to keep track of the current zone. It's mostly just listening to the zone changed events but there are a few peculiarities in it. Might be useful to have that built in the library as well.

  • Avatar of Cyprias Cyprias May 31, 2010 at 19:01 UTC - 0 likes

    Nice. I've wondered why nobody did this before.

    http://bip32.com/qr/y2Hj.png

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
152,611
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