extract tile-name

This commit is contained in:
Daniel Barlow 2025-06-09 13:19:47 +01:00
parent 4edf246cf6
commit 406cedbce1

View File

@ -109,8 +109,11 @@
;; we'd like to have a way for completed background fetch to signal
;; so that the map can be redrawn
(fn tile-name [x y zoom]
(.. x "_" y "_" zoom))
(fn polylines [cq x y zoom cb]
(let [k (.. x "_" y "_" zoom)
(let [k (tile-name x y zoom)
pathname (.. "/tmp/tiles/" k ".json")]
(if (file-exists? pathname)
(let [data (with-open [i (io.open pathname :r)] (i:read "*a"))]
@ -138,4 +141,4 @@
{ : polylines : latlon->tile }
{ : polylines : latlon->tile :name tile-name }