BSD-3-Clause licensed by Joe Canero
Maintained by [email protected]
This version can be pinned in stack with:tile-0.1.0.0@sha256:ff16add9419cca61a38fe73b536588bd1d760783b6876f2d9872b70b2a7be8fe,1064

Module documentation for 0.1.0.0

Depends on 1 package(full list with versions):

tile

Haskell library for interfacing with slippy map tiles and converting between Pixel, Tile, and LngLat types.

Basic Usage

Converting between the three main types, Pixel, Tile, and LngLat is a major piece of this library’s functionality.

Convert LngLat to Tile

Convert a longitude and latitude pair at a given zoom level into a tile.


lngLatToTile (Z 8) (LngLat (Lng (-74.17250), Lat 40.39187))
-- returns Tile (Z 8, X 75, Y 96)

Convert LngLat to Pixel

Convert a longitude and latitude pair at a given zoom level into a pixel on the map.


lngLatToPixel (Z 8) (LngLat (Lng (-74.17250), Lat 40.39187))
-- returns Pixel (Px 19265,Py 24717)

Convert Tile to LngLat

Convert a tile back to a longitude and latitude pair.


tileToLngLat (Tile (Z 1, X 1, Y 0))
-- returns LngLat (Lng 0.0, Lat 85.05112877980659)

Convert Tile to Pixel

Convert a tile into a pixel on the map.


tileToPixel (Tile (Z 1, X 1, Y 0))
-- returns Pixel (Px 256,Py 0)

Convert Pixel to Tile

Convert a pixel to a tile.


pixelToTile (Z 1) $ Pixel (Px 256,Py 0)
-- returns Tile (Z 1,X 1,Y 0)

Convert Pixel to LngLat

Convert a pixel into a longitude and latitude pair.


pixelToLngLat (Z 8) $ Pixel (Px 19265,Py 24717)
-- returns LngLat (Lng (-74.1741943359375),Lat 40.39258071969131)

Subtiles

Get the children of a given tile.


subTiles (Tile (Z 1, X 1, Y 0))
-- returns [
--    Tile (Z 2, X 2, Y 0)
--  , Tile (Z 2, X 2, Y 1)
--  , Tile (Z 2, X 3, Y 0)
--  , Tile (Z 2, X 3, Y 1)
--  ]