Skip to content

Commit

Permalink
constrain max bounds to restrict map to Europe only
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddewie committed Jul 21, 2024
1 parent 08097ed commit f6b6bd7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions proxy/js/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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 => {
Expand Down

0 comments on commit f6b6bd7

Please sign in to comment.