From 96f1e3bef9e2054f7d619775ac59abdb88e12d54 Mon Sep 17 00:00:00 2001 From: Chandler Swift Date: Wed, 12 Feb 2025 22:32:28 -0600 Subject: [PATCH 1/3] Set "Content-Type: application/json" --- main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/main.go b/main.go index c94a3f2..7c546d3 100644 --- a/main.go +++ b/main.go @@ -57,6 +57,7 @@ func main() { }) http.HandleFunc("GET /api/sidewalks", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") json.NewEncoder(w).Encode(sidewalks) }) From f90830ff934d6a0e2aaa8073f4598fba3a692811 Mon Sep 17 00:00:00 2001 From: Chandler Swift Date: Wed, 12 Feb 2025 22:32:53 -0600 Subject: [PATCH 2/3] Unsaturate background map to improve contrast --- static/index.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/static/index.html b/static/index.html index 70b64ed..0065d62 100644 --- a/static/index.html +++ b/static/index.html @@ -14,6 +14,9 @@ width: 100%; background-color: black; } + .grayscale { + filter: saturate(0.4); + } From 1bc68692ccc694a2696bf08172d803c81c4801ae Mon Sep 17 00:00:00 2001 From: Chandler Swift Date: Wed, 12 Feb 2025 22:33:17 -0600 Subject: [PATCH 3/3] Increase colors/weights at Robin's request --- static/index.html | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/static/index.html b/static/index.html index 0065d62..e09b26e 100644 --- a/static/index.html +++ b/static/index.html @@ -34,13 +34,14 @@ // Set up the OpenStreetMap tile layer L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { opacity: 0.6, + className: 'grayscale', attribution: '© OpenStreetMap contributors' }).addTo(map); const CONDITIONS = [ - {name: "Unknown", color: "gray"}, - {name: "Clear", color: "green"}, - {name: "PartiallyCovered", color: "yellow"}, + {name: "Unknown", color: "#444"}, + {name: "Clear", color: "#04591b"}, + {name: "Partially Covered", color: "yellow"}, {name: "Covered", color: "red"}, ]; @@ -52,19 +53,19 @@ for (let [i, way] of osmData.entries()) { const polyline = L.polyline(way.Geometry, { color: CONDITIONS[way.Condition].color, - weight: 5, + weight: 10, opacity: 0.7 }).addTo(map); polyline.on('mouseover', function(e) { e.target.setStyle({ - weight: 10, + weight: 20, opacity: 1, }); }); polyline.on('mouseout', function(e){ e.target.setStyle({ - weight: 5, + weight: 10, opacity: 0.7, }); });