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 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
  • Avatar of kagaro kagaro Jul 08, 2012 at 13:58 UTC - 0 likes

    @kaelspriest: Go

    go for it

  • Avatar of kagaro kagaro Apr 14, 2012 at 21:35 UTC - 0 likes

    i need to regerenate data

  • Avatar of wxx011 wxx011 Apr 03, 2012 at 04:56 UTC - 0 likes

    Entering darkmoonfaire It shows LibMapData-1.0 is missing data for 823

  • Avatar of kaelspriest kaelspriest Jan 23, 2012 at 21:29 UTC - 0 likes

    May I have permission to use this in my addon? (raidframes)

  • Avatar of iispyderii iispyderii Dec 19, 2011 at 16:07 UTC - 0 likes

    If you look at the API documentation for GetPlayerMapPosition() you will see that it returns (0,0) for all classic instances except for Northrend; so I believe that is not the case. As I said, it was working in the PTR but i think i had some of the values mixed up.

  • Avatar of michaelspain michaelspain Dec 17, 2011 at 02:17 UTC - 0 likes

    Seems a blizzard fault, in Warmaster blackhorn area:
    GetPlayerMapPosition("player")  always returns 0,0 instead of valid coordintates.
    So it is not posible to fix the issue.

    Last edited Dec 17, 2011 by michaelspain
  • Avatar of iispyderii iispyderii Dec 16, 2011 at 18:41 UTC - 0 likes

    I'm getting the same as Remota. I had it working in the PTR at one point but now it's not working showing placements for PoH and CoH from GridStatusPriestAoE. Given the maps are so small it really doesn't matter too much but it's nice to have an optimal placement for the spells.

  • Avatar of Remota Remota Dec 13, 2011 at 20:17 UTC - 0 likes

    warmaster blackhorn and spine of deathwing doesn't work for me..

  • Avatar of kagaro kagaro Dec 02, 2011 at 00:28 UTC - 0 likes

    tagging a new release now

Facts

Date created
May 30, 2010
Categories
Last update
Dec 22, 2014
Development stage
Release
Language
  • enUS
License
All Rights Reserved
Curse link
LibMapData-1.0
Reverse relationships
1
Downloads
168,939
Recent files
  • A: r147 for 6.0.3 Dec 22, 2014
  • A: r146 for 6.0.3 Nov 21, 2014
  • R: 0.31 for 6.0.2 Oct 17, 2014
  • A: r144 for 6.0.2 Oct 17, 2014
  • A: r143 for 6.0.2 Oct 16, 2014

Authors

Relationships

Tool used
DataTools
Embedded library
CallbackHandler-1.0
LibStub