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.
This commit is contained in:
Eli Ribble 2025-11-15 22:02:50 +00:00
parent a14249710d
commit 930906dba3
No known key found for this signature in database

View file

@ -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
});