Logos und ein bisschen Layout
This commit is contained in:
73
main.js
73
main.js
@@ -102,32 +102,52 @@ function changeBaseMap(newMap){
|
||||
}
|
||||
break;
|
||||
case "satellite_terrain":
|
||||
basemapStyle = {
|
||||
version: 8,
|
||||
sources: {
|
||||
"satellite": {
|
||||
type: "raster",
|
||||
tiles: [
|
||||
"https://mt0.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
|
||||
"https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
|
||||
"https://mt2.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
|
||||
"https://mt3.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
|
||||
basemapStyle = {
|
||||
version: 8,
|
||||
sources: {
|
||||
osm: {
|
||||
type: 'raster',
|
||||
tiles: [
|
||||
"https://mt0.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
|
||||
"https://mt1.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
|
||||
"https://mt2.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
|
||||
"https://mt3.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
|
||||
],
|
||||
tileSize: 256,
|
||||
},
|
||||
// ── Elevation data ──────────────────────────
|
||||
"terrarium": {
|
||||
type: "raster-dem",
|
||||
tiles: ["https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png"],
|
||||
tileSize: 256,
|
||||
encoding: "terrarium",
|
||||
maxzoom: 15
|
||||
},
|
||||
},
|
||||
layers: [{ id: "satellite", type: "raster", source: "satellite" }],
|
||||
// 2-fache Überhöhung
|
||||
terrain: { source: "terrarium", exaggeration: 2 },
|
||||
}
|
||||
tileSize: 256,
|
||||
attribution: '© OpenStreetMap Contributors',
|
||||
maxzoom: 19
|
||||
},
|
||||
// Use a different source for terrain and hillshade layers, to improve render quality
|
||||
terrainSource: {
|
||||
type: 'raster-dem',
|
||||
url: 'https://tiles.mapterhorn.com/tilejson.json',
|
||||
},
|
||||
hillshadeSource: {
|
||||
type: 'raster-dem',
|
||||
url: 'https://tiles.mapterhorn.com/tilejson.json'
|
||||
}
|
||||
},
|
||||
layers: [
|
||||
{
|
||||
id: 'osm',
|
||||
type: 'raster',
|
||||
source: 'osm'
|
||||
},
|
||||
{
|
||||
id: 'hills',
|
||||
type: 'hillshade',
|
||||
source: 'hillshadeSource',
|
||||
layout: {visibility: 'visible'},
|
||||
paint: {'hillshade-shadow-color': '#473B24'}
|
||||
}
|
||||
],
|
||||
terrain: {
|
||||
source: 'terrainSource',
|
||||
exaggeration: 1
|
||||
},
|
||||
sky: {}
|
||||
}
|
||||
|
||||
}
|
||||
map.setStyle(basemapStyle);
|
||||
}
|
||||
@@ -142,4 +162,5 @@ selectElement.addEventListener('change', (event) => {
|
||||
// Karte auf Nord zurücksetzen
|
||||
document.getElementById("resetBtn").addEventListener("click", () => {
|
||||
map.resetNorth();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user