biscuit

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 39f687d6f5901b642287b82a8a4fa5c23625e752
parent f8a4788ed69b198451e1225775b28c3c81c9029d
Author: Daniel Barlow <dan@telent.net>
Date:   Mon,  2 Jun 2025 21:15:56 +0100

pass zoom level to canvas

Diffstat:
Mpkgs/maps/tiles.fnl | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/pkgs/maps/tiles.fnl b/pkgs/maps/tiles.fnl @@ -59,7 +59,7 @@ ] (table.concat "\n")))) -(fn canvas [elements] +(fn canvas [elements zoom] (let [nodes {} lines {}] (each [_ e (ipairs elements)] @@ -71,7 +71,7 @@ e.id (icollect [_ nd (ipairs e.nodes)] (let [node (. nodes nd) - (tx ty) (latlon->tile node.lat node.lon 17)] + (tx ty) (latlon->tile node.lat node.lon zoom)] ;;(print e.tags.name e.id e.name node.lat node.lon) [ tx ty ]))))) lines)) @@ -111,7 +111,7 @@ (let [data (with-open [i (io.open pathname :r)] (i:read "*a"))] (if (= data "") [] - (canvas (. (json.decode data) :elements)))) + (canvas (. (json.decode data) :elements) zoom))) (let [out (io.open pathname :w)] (cq:wrap (fn [] (print "getting " k)