mono/packages/ui/src/modules/places/components/map-styles.ts
2026-03-22 17:35:50 +01:00

41 lines
1.3 KiB
TypeScript

export const MAP_STYLE_OSM_3D = {
version: 8 as const,
sources: {
osm: {
type: 'raster' as const,
tiles: ['https://a.tile.openstreetmap.org/{z}/{x}/{y}.png'],
tileSize: 256,
attribution: '© OpenStreetMap Contributors',
maxzoom: 19
},
terrainSource: {
type: 'raster-dem' as const,
url: 'https://api.maptiler.com/tiles/terrain-rgb-v2/tiles.json?key=aQ5CJxgn3brYPrfV3ws9',
tileSize: 256
},
hillshadeSource: {
type: 'raster-dem' as const,
url: 'https://api.maptiler.com/tiles/terrain-rgb-v2/tiles.json?key=aQ5CJxgn3brYPrfV3ws9',
tileSize: 256
}
},
layers: [
{ id: 'osm', type: 'raster' as const, source: 'osm' },
{
id: 'hills', type: 'hillshade' as const, source: 'hillshadeSource',
layout: { visibility: 'visible' as const },
paint: { 'hillshade-shadow-color': '#473B24' }
}
],
terrain: { source: 'terrainSource', exaggeration: 1 },
sky: {}
};
export const MAP_STYLES = {
light: MAP_STYLE_OSM_3D,
dark: 'https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json',
osm_raster: MAP_STYLE_OSM_3D
};
export type MapStyleKey = keyof typeof MAP_STYLES;