Tirex::Map(3pm)

πŸ’– Tirex::Map πŸ’–

okay bestie, so this is the page for Tirex::Map β€” that's the module living in section 3pm of the User Contributed Perl Documentation, aka the perl docs that actual humans wrote. Sit down, get comfy, we're learning map configs πŸ—ΊοΈβœ¨


✨ NAME ✨

Tirex::Map β€” it's giving "a Tirex map configuration", because that's literally what it is πŸ’…


🌸 SYNOPSIS 🌸

my $map = Tirex::Map->new();

that's it. that's the whole vibe check. you make a map, you're in business πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

So a Tirex::Map is a map configuration, no cap. Every single one of them always has these three things locked in:

  • the name πŸ‘‘
  • the tile directory πŸ“
  • the zoom range πŸ”

...and depending on which backend you're rolling with, there can be more options on top of that. backend-dependent behavior, we love a flexible icon 🌈


πŸ’… METHODS πŸ’…

Tirex::Map->get('foo')

Get a map by name. You hand it the name, it hands you the map. simple as 🫢

Tirex::Map->clear();

Clears the list of maps. poof, gone, empty slate ✨

Tirex::Map->get_map_for_metatile($metatile)

Gets the map for a metatile. sounds chill right? WRONG (affectionately) because this one is dramatic 😭

  • It will croak if the map named in the metatile does not exist πŸ’€
  • It will also croak if the zoom given in the metatile is out of range πŸ’€πŸ’€

so like, respect the metatile or face the croak. iykyk.

Tirex::Map->new( ... )

Creates a new map configuration. main character energy, it's the constructor πŸŽ€

Default values, and this is important so write it down:

  • minz (minimum zoom) defaults to 0
  • maxz (maximum zoom) defaults to 17

those are the defaults bestie, don't come for me πŸ“

Tirex::Map->new_from_configfile($filename, $renderer)

Creates a new map config from a file, for a given renderer. two args, one glow-up ✨

⚠️ Heads up: it croaks if the file does not exist. no file, no map, no mercy πŸ’€

$map->get_name()

Gets the name of this map. iconic, brief, does exactly what it says πŸ‘‘

$map->get_renderer()

Gets the renderer of this map. who's rendering? this map's renderer, that's who 🎨

$map->get_filename()

Gets the filename of the config file for this map.

🚨 okay so listen: this only works if the map was created from a config file. If it wasn't, it will return undef. so if you get nothing back, that's not a bug, that's the map being like "no config file bestie, sorry" πŸ™ˆ

$map->get_tiledir()

Gets the tile directory of this map. your tiles live there, that's their home 🏠

$map->get_minz()

Gets the minimum zoom value of this map. the floor, the basement, the starting point ⬇️

$map->get_maxz()

Gets the maximum zoom of this map. the ceiling, the limit, the final boss ⬆️

$map->to_s();

Returns a human readable description of this map. yes, human readable, because we're not doing cryptic nonsense today 🫢

$map->to_hash();

Returns the parameters of this map as a hash. hash supremacy πŸ”₯

Tirex::Map->status();

Returns the status of all configured maps. all of them. every last one. go off king πŸ‘‘


and that's the whole page, bestie!! you understood it, you slayed it, periodt πŸ’–


this little documentation moment was brought to you by perl v5.40.1, dated 2026-08-09, and it lives at Tirex::Map(3pm) in the User Contributed Perl Documentation. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from