From 930906dba3932e5e7bbc20b0dfb0685e7611a257 Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Sat, 15 Nov 2025 22:02:50 +0000 Subject: [PATCH] Filter vector tiles by resolution This is not really efficient - we're pulling across high-resolution data then throwing it away on the frontend. But it proves the important thing: that we're loading the data correctly. --- templates/dashboard.html | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/templates/dashboard.html b/templates/dashboard.html index a87252d5..5abb35f9 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -41,32 +41,21 @@ function onLoad() { 'type': 'fill', 'source': 'tegola-bonn', // ID of the tile source created above 'source-layer': 'lakes', - 'layout': { - 'line-cap': 'round', - 'line-join': 'round' - }, 'paint': { 'fill-opacity': 0.1, - 'line-opacity': 0.6, - 'line-color': 'rgb(53, 175, 109)', - 'line-width': 2 + 'fill-color': 'rgb(100, 50, 20)' } //slot: 'middle' // middle slot in Mapbox Standard style }); map.addLayer({ 'id': 'nidus', // Layer ID 'type': 'fill', + 'filter': ['==', ['zoom'], ['+', 2, ['to-number', ['get', 'resolution']]]], 'source': 'tegola-nidus', // ID of the tile source created above 'source-layer': 'h3_aggregation', - 'layout': { - 'line-cap': 'round', - 'line-join': 'round' - }, 'paint': { 'fill-opacity': 0.3, - 'line-opacity': 0.6, - 'line-color': 'rgb(53, 175, 109)', - 'line-width': 2 + 'fill-color': 'rgb(250, 100, 100)' } //slot: 'middle' // middle slot in Mapbox Standard style });