pass zoom level to canvas
This commit is contained in:
parent
05401941b4
commit
35f0f3c71e
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user