From 11e50657c900543856f3a1f56a96d6c861f55b6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustav=20S=C3=B6rn=C3=A4s?= Date: Fri, 20 Nov 2020 13:05:30 +0100 Subject: allow sending squares with shortest path response --- templates/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/index.js b/templates/index.js index b7b3b58..99701d0 100644 --- a/templates/index.js +++ b/templates/index.js @@ -31,6 +31,9 @@ async function postShortestPath(event){ console.log(res.path) var poly = L.polyline(res.path).addTo(map) + for (const square of res.squares) { + L.rectangle(square.bounds, {color: square.color, weight: 1, fill: false}).addTo(map) + } } function handleMapClick ({latlng}){ -- cgit v1.2.1