Improve operational GIS map workflow
GeoIntel CI / docs-smoke (push) Has been cancelled
GeoIntel CI / contract-smoke (push) Has been cancelled

This commit is contained in:
Codex
2026-07-04 23:29:33 +02:00
parent 531c4e4e1d
commit 21374ed187
10 changed files with 246 additions and 4 deletions
+33 -1
View File
@@ -23,6 +23,30 @@ const EMPTY_FEATURE_COLLECTION: GeoJSON.FeatureCollection = {
features: [],
}
const DEFAULT_ROAD_BASEMAP_STYLE: maplibregl.StyleSpecification = {
version: 8,
sources: {
'osm-standard': {
type: 'raster',
tiles: ['https://tile.openstreetmap.org/{z}/{x}/{y}.png'],
tileSize: 256,
attribution: '© OpenStreetMap contributors',
maxzoom: 19,
},
},
layers: [
{
id: 'osm-standard',
type: 'raster',
source: 'osm-standard',
},
],
}
function defaultMapStyle(): string | maplibregl.StyleSpecification {
return import.meta.env.VITE_MAP_STYLE_URL || DEFAULT_ROAD_BASEMAP_STYLE
}
function collectCoordinates(featureCollection: GeoJSON.FeatureCollection): maplibregl.LngLatBoundsLike | null {
const coordinates: [number, number][] = []
const walk = (coords: unknown) => {
@@ -137,11 +161,19 @@ function GeoMap({
const map = new maplibregl.Map({
container: containerRef.current,
style: import.meta.env.VITE_MAP_STYLE_URL || 'https://demotiles.maplibre.org/style.json',
style: defaultMapStyle(),
center: [5.3, 51.3],
zoom: 9,
attributionControl: false,
})
map.addControl(new maplibregl.NavigationControl(), 'top-right')
map.addControl(
new maplibregl.AttributionControl({
compact: true,
customAttribution: 'Basemap © OpenStreetMap contributors',
}),
'bottom-right',
)
map.on('load', () => {
setMapStyleReady(true)
})