map::slippy - Common code for slippy based map packages
This package provides a number of methods doing things needed by all types of slippy-based map packages.
This method returns the width/height of a slippy-based map at the specified zoom level, in pixels. This is, in essence, the result of
expr { [tiles $level] * [tile size] }
This method returns the width/height of a slippy-based map at the specified zoom level, in tiles.
This method returns the width/height of a tile in a slippy-based map, in pixels.
This method checks whether tile described a valid tile in a slippy-based map containing that many zoom levels. The result is a boolean value, true if the tile is valid, and false otherwise. For the latter a message is left in the variable named by msgvar, should it be specified.
A tile identifier as stored in tile is a list containing zoom level, tile row, and tile column, in this order. The command essentially checks this, i.e. the syntax, that the zoom level is between 0 and "levels-1", and that the row/col information is within the boundaries for the zoom level, i.e. 0 ... "[tiles $zoom]-1".
Converts a geographical location at a zoom level (geo, a list containing zoom level, latitude, and longitude, in this order) to a tile identifier (list containing zoom level, row, and column) at that level.
Converts a geographical location at a zoom level (geo, a list containing zoom level, latitude, and longitude, in this order) to a pixel position (list containing zoom level, y, and x) at that level.
Converts a tile identifier at a zoom level (tile, list containing zoom level, row, and column) to a geographical location (list containing zoom level, latitude, and longitude, in this order) at that level.
Converts a tile identifier at a zoom level (tile, a list containing zoom level, row, and column, in this order) to a pixel position (list containing zoom level, y, and x) at that level.
Converts a pixel position at a zoom level (point, list containing zoom level, y, and x) to a geographical location (list containing zoom level, latitude, and longitude, in this order) at that level.
Converts a pixel position at a zoom level (point, a list containing zoom level, y, and x, in this order) to a tile identifier (list containing zoom level, row, and column) at that level.