feat: add switchable raster map styles
This commit is contained in:
parent
c204faaa9f
commit
646ac23823
6 changed files with 196 additions and 6 deletions
|
|
@ -14,16 +14,18 @@ mbtiles:
|
|||
- /data
|
||||
|
||||
# MapLibre GL Styles aus /data/styles/ servieren
|
||||
# -> GET /styles/{id} (Style-JSON fuer MapLibre GL Clients)
|
||||
# -> GET /style/{id} (Style-JSON fuer MapLibre GL Clients)
|
||||
# -> GET /style/{id}/{z}/{x}/{y}.png|jpg (serverseitig gerenderte Raster-Tiles)
|
||||
styles:
|
||||
paths:
|
||||
- /data/styles
|
||||
rendering: true
|
||||
|
||||
# Sprites (Icons, Pins, Marker) aus /data/sprites/
|
||||
# -> GET /sprites/{id}.json und /sprites/{id}.png
|
||||
sprites:
|
||||
- /data/sprites
|
||||
|
||||
# Schriftarten fuer Karten-Labels
|
||||
# -> GET /fonts/{font_name}/{start}-{end}.pbf
|
||||
# fonts:
|
||||
# - /data/fonts
|
||||
# Hinweis: Martin erwartet im fonts.paths Verzeichnis TTF/OTF Font-Dateien.
|
||||
# In diesem Stack liegen bereits vorberechnete PBF-Glyph-Ranges in /data/fonts,
|
||||
# daher bleibt fonts hier deaktiviert.
|
||||
|
|
|
|||
90
config/styles/europa-detail.json
Normal file
90
config/styles/europa-detail.json
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
{
|
||||
"version": 8,
|
||||
"name": "Europa Detail",
|
||||
"sources": {
|
||||
"openmaptiles": {
|
||||
"type": "vector",
|
||||
"url": "mbtiles://{osm-europe}"
|
||||
}
|
||||
},
|
||||
"glyphs": "/fonts/{fontstack}/{range}.pbf",
|
||||
"layers": [
|
||||
{
|
||||
"id": "background",
|
||||
"type": "background",
|
||||
"paint": {
|
||||
"background-color": "#f7f5ee"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "water",
|
||||
"type": "fill",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "water",
|
||||
"paint": {
|
||||
"fill-color": "#9ec9ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "landuse",
|
||||
"type": "fill",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "landuse",
|
||||
"paint": {
|
||||
"fill-color": "#d8e7cc",
|
||||
"fill-opacity": 0.7
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "roads-major",
|
||||
"type": "line",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"filter": [
|
||||
"in",
|
||||
"class",
|
||||
"motorway",
|
||||
"trunk",
|
||||
"primary"
|
||||
],
|
||||
"paint": {
|
||||
"line-color": "#f7b267",
|
||||
"line-width": [
|
||||
"interpolate",
|
||||
[
|
||||
"linear"
|
||||
],
|
||||
[
|
||||
"zoom"
|
||||
],
|
||||
5,
|
||||
0.5,
|
||||
16,
|
||||
3.5
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "roads-minor",
|
||||
"type": "line",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"paint": {
|
||||
"line-color": "#ffffff",
|
||||
"line-width": [
|
||||
"interpolate",
|
||||
[
|
||||
"linear"
|
||||
],
|
||||
[
|
||||
"zoom"
|
||||
],
|
||||
8,
|
||||
0.2,
|
||||
16,
|
||||
2.0
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
21
config/styles/satelite-world.json
Normal file
21
config/styles/satelite-world.json
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"version": 8,
|
||||
"name": "Satelite World",
|
||||
"sources": {
|
||||
"satellite": {
|
||||
"type": "raster",
|
||||
"url": "mbtiles://{satellite}",
|
||||
"tileSize": 256
|
||||
}
|
||||
},
|
||||
"layers": [
|
||||
{
|
||||
"id": "satellite-raster",
|
||||
"type": "raster",
|
||||
"source": "satellite",
|
||||
"paint": {
|
||||
"raster-opacity": 1.0
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
60
config/styles/world.json
Normal file
60
config/styles/world.json
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
"version": 8,
|
||||
"name": "World",
|
||||
"sources": {
|
||||
"openmaptiles": {
|
||||
"type": "vector",
|
||||
"url": "mbtiles://{osm}"
|
||||
}
|
||||
},
|
||||
"glyphs": "/fonts/{fontstack}/{range}.pbf",
|
||||
"layers": [
|
||||
{
|
||||
"id": "background",
|
||||
"type": "background",
|
||||
"paint": {
|
||||
"background-color": "#f2efe9"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "water",
|
||||
"type": "fill",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "water",
|
||||
"paint": {
|
||||
"fill-color": "#a9d3ff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "landcover",
|
||||
"type": "fill",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "landcover",
|
||||
"paint": {
|
||||
"fill-color": "#dcebcf"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "roads",
|
||||
"type": "line",
|
||||
"source": "openmaptiles",
|
||||
"source-layer": "transportation",
|
||||
"paint": {
|
||||
"line-color": "#ffffff",
|
||||
"line-width": [
|
||||
"interpolate",
|
||||
[
|
||||
"linear"
|
||||
],
|
||||
[
|
||||
"zoom"
|
||||
],
|
||||
5,
|
||||
0.3,
|
||||
14,
|
||||
2.0
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -10,11 +10,26 @@
|
|||
"styles": {
|
||||
"osm-intl": {
|
||||
"style": "osm-intl.json"
|
||||
},
|
||||
"world": {
|
||||
"style": "world.json"
|
||||
},
|
||||
"europa-detail": {
|
||||
"style": "europa-detail.json"
|
||||
},
|
||||
"satelite-world": {
|
||||
"style": "satelite-world.json"
|
||||
}
|
||||
},
|
||||
"data": {
|
||||
"osm": {
|
||||
"mbtiles": "osm.mbtiles"
|
||||
},
|
||||
"osm-europe": {
|
||||
"mbtiles": "osm-europe.mbtiles"
|
||||
},
|
||||
"satellite": {
|
||||
"mbtiles": "satellite.mbtiles"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ services:
|
|||
- ./data/fonts:/data/fonts:ro
|
||||
- ./data/sprites:/data/sprites:ro
|
||||
- ./data/osm.mbtiles:/data/osm.mbtiles:ro
|
||||
- ./data/osm-europe.mbtiles:/data/osm-europe.mbtiles:ro
|
||||
- ./data/satellite.mbtiles:/data/satellite.mbtiles:ro
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "node", "-e", "require('http').get('http://localhost:8080/health', r => process.exit(r.statusCode === 200 ? 0 : 1))"]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue