From 441120efd63f31fa05c68575abc28c67c1a1245c Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Mon, 2 Jun 2025 21:15:56 +0100 Subject: [PATCH] pass zoom level to canvas --- pkgs/maps/tiles.fnl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/maps/tiles.fnl b/pkgs/maps/tiles.fnl index 45bc3e2..f339693 100644 --- a/pkgs/maps/tiles.fnl +++ b/pkgs/maps/tiles.fnl @@ -60,7 +60,7 @@ ] (table.concat "\n")))) -(fn canvas [elements] +(fn canvas [elements zoom] (let [nodes {} lines {}] (each [_ e (ipairs elements)] @@ -72,7 +72,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)) @@ -112,7 +112,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)