From f6b6bd7916b7556e381833ae1b50c6bcde1e3366 Mon Sep 17 00:00:00 2001 From: Hidde Wieringa Date: Sun, 21 Jul 2024 19:02:34 +0200 Subject: [PATCH] constrain max bounds to restrict map to Europe only --- .github/workflows/deploy.yml | 2 +- SETUP.md | 2 +- docker-compose.yml | 2 +- proxy/js/ui.js | 6 ++++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 678e00e5..53771d8f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -61,7 +61,7 @@ jobs: - name: Generate tiles env: TILES: ${{ matrix.tiles }} - BBOX: '-11.3818,35.8891,25.0488,57.3976' + BBOX: '-10.0,35.7,39.0,70.0' run: | docker compose run martin-cp ls -las tiles/ diff --git a/SETUP.md b/SETUP.md index b6a5f17e..08882ff9 100644 --- a/SETUP.md +++ b/SETUP.md @@ -44,7 +44,7 @@ docker compose run --build import import Build the tiles: ```shell -export BBOX='-11.3818,35.8891,25.0488,57.3976' +export BBOX='-11.3818,35.8891,25.0488,70.0' for tile in low-med standard speed signals electrification gauge do env "TILES=$tiles" docker compose up martin-cp done diff --git a/docker-compose.yml b/docker-compose.yml index 308a20c9..df228d27 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -68,7 +68,7 @@ services: - ./martin:/config - ./tiles:/tiles environment: - # Europe center: -11.3818,35.8891,25.0488,57.3976 + # Europe center: -10.0,35.7,39.0,70.0 # AT: 9.52678,46.36851,17.16273,48.90201 # CH: 6.0974,45.8269,10.5579,47.7941 # DE: 5.864417,47.26543,15.05078,55.14777 diff --git a/proxy/js/ui.js b/proxy/js/ui.js index 0ddb074e..7f4c8498 100644 --- a/proxy/js/ui.js +++ b/proxy/js/ui.js @@ -223,7 +223,8 @@ function removeDomElement(node) { } const globalMinZoom = 1; -const glodalMaxZoom = 18; +const globalMaxZoom = 18; +const globalMaxBounds = [[-10.0, 35.7], [39.0, 70.0]]; const knownStyles = { standard: 'Infrastructure', @@ -338,9 +339,10 @@ const map = new maplibregl.Map({ container: 'map', hash: 'view', minZoom: globalMinZoom, - maxZoom: glodalMaxZoom, + maxZoom: globalMaxZoom, minPitch: 0, maxPitch: 0, + maxBounds: globalMaxBounds, }); const onStyleChange = changedStyle => {