commit 966026b3e7691b70802f3b2b3654c985f0a0e347
parent 795e63d7732460bdf3644e62f5227c3f81d3d148
Author: Daniel Barlow <dan@telent.net>
Date: Sat, 23 Nov 2024 12:04:06 +0000
add helpful(?) comment
Diffstat:
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/frontend/src/TileMap.elm b/frontend/src/TileMap.elm
@@ -59,14 +59,13 @@ pixelsToCoord z (x,y) =
reflect : Coord -> Coord
reflect c = Coord -c.x -c.y
--- translate : a -> a -> a
+-- used for Coords and for TileNumbers
translate base offset =
{ x = (base.x + offset.x), y = (base.y + offset.y) }
translatePixels : Coord -> ZoomLevel -> (Int, Int) -> Coord
translatePixels old z (x, y) = translate old (pixelsToCoord z (x, y))
-
tileCovering : Coord -> ZoomLevel -> TileNumber
tileCovering c z =
TileNumber (truncate (toFloat (2 ^ z) * c.x)) (truncate (toFloat (2 ^ z) * c.y))