From 69eba834f34489827af08363b49fae7dc366e28f Mon Sep 17 00:00:00 2001 From: petr-hajek Date: Mon, 30 Sep 2024 16:43:57 +0200 Subject: [PATCH] update GH Action & update gh pages config --- .github/workflows/deploy-gh-pages.yml | 4 +- public/config/gh-pages.js | 126 ++------------------------ 2 files changed, 13 insertions(+), 117 deletions(-) diff --git a/.github/workflows/deploy-gh-pages.yml b/.github/workflows/deploy-gh-pages.yml index b1a8102..7a86cba 100644 --- a/.github/workflows/deploy-gh-pages.yml +++ b/.github/workflows/deploy-gh-pages.yml @@ -1,7 +1,7 @@ on: push: branches: - - main + - maptiler permissions: contents: write @@ -23,6 +23,8 @@ jobs: yarn install --network-concurrency 1 cp public/config/gh-pages.js public/config/local.js BASE_PATH=/maperture/ yarn build + env: + MAPTILER_API_KEY: ${{ secrets.MAPTILER_API_KEY }} - name: deploy uses: JamesIves/github-pages-deploy-action@v4 with: diff --git a/public/config/gh-pages.js b/public/config/gh-pages.js index 7bd4175..857a717 100644 --- a/public/config/gh-pages.js +++ b/public/config/gh-pages.js @@ -1,126 +1,20 @@ const mapboxGlAccessToken = 'pk.eyJ1Ijoic3RhbWVuIiwiYSI6ImNreWM1emM2NjAyNTgyb25kc2o5ZG1iMmoifQ.o2QhFbe03ilcplg9sAhYZQ'; +const maptilerApiKey = process.env.MAPTILER_API_KEY; + const stylePresets = [ { - id: 'mapbox-streets', - name: 'Mapbox Streets', - type: 'mapbox-gl', - url: 'mapbox://styles/mapbox/streets-v11', - }, - { - id: 'mapbox-outdoors', - name: 'Mapbox Outdoors', - type: 'mapbox-gl', - url: 'mapbox://styles/mapbox/outdoors-v11', - }, - { - id: 'mapbox-light', - name: 'Mapbox Light', - type: 'mapbox-gl', - url: 'mapbox://styles/mapbox/light-v10', - }, - { - id: 'mapbox-dark', - name: 'Mapbox Dark', - type: 'mapbox-gl', - url: 'mapbox://styles/mapbox/dark-v10', - }, - { - id: 'openstreetmap', - name: 'OpenStreetMap', - type: 'leaflet', - url: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', - attribution: - '© OpenStreetMap contributors', - }, - { - id: 'stamen-toner', - name: 'Stamen Toner', - type: 'leaflet', - url: 'https://stamen-tiles.a.ssl.fastly.net/toner/{z}/{x}/{y}.png', - attribution: - 'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.', - }, - { - id: 'stamen-toner-lite', - name: 'Stamen Toner (Lite)', - type: 'leaflet', - url: 'https://stamen-tiles.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}.png', - attribution: - 'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.', - }, - { - id: 'stamen-toner-hybrid', - name: 'Stamen Toner (Hybrid)', - type: 'leaflet', - url: 'https://stamen-tiles.a.ssl.fastly.net/toner-hybrid/{z}/{x}/{y}.png', - attribution: - 'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.', - }, - { - id: 'stamen-toner-labels', - name: 'Stamen Toner (Labels)', - type: 'leaflet', - url: 'https://stamen-tiles.a.ssl.fastly.net/toner-labels/{z}/{x}/{y}.png', - attribution: - 'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.', - }, - { - id: 'stamen-toner-lines', - name: 'Stamen Toner (Lines)', - type: 'leaflet', - url: 'https://stamen-tiles.a.ssl.fastly.net/toner-lines/{z}/{x}/{y}.png', - attribution: - 'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.', - }, - { - id: 'stamen-toner-background', - name: 'Stamen Toner (Background)', - type: 'leaflet', - url: 'https://stamen-tiles.a.ssl.fastly.net/toner-background/{z}/{x}/{y}.png', - attribution: - 'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.', - }, - { - id: 'stamen-terrain', - name: 'Stamen Terrain', - type: 'leaflet', - url: 'https://stamen-tiles.a.ssl.fastly.net/terrain/{z}/{x}/{y}.png', - attribution: - 'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.', - }, - { - id: 'stamen-terrain-labels', - name: 'Stamen Terrain (Labels)', - type: 'leaflet', - url: 'https://stamen-tiles.a.ssl.fastly.net/terrain-labels/{z}/{x}/{y}.png', - attribution: - 'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.', - }, - { - id: 'stamen-terrain-lines', - name: 'Stamen Terrain (Lines)', - type: 'leaflet', - url: 'https://stamen-tiles.a.ssl.fastly.net/terrain-lines/{z}/{x}/{y}.png', - attribution: - 'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.', - }, - { - id: 'stamen-terrain-background', - name: 'Stamen Terrain (Background)', - type: 'leaflet', - url: 'https://stamen-tiles.a.ssl.fastly.net/terrain-background/{z}/{x}/{y}.png', - attribution: - 'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.', + id: 'streets', + name: 'Streets', + type: 'maptiler-sdk', + url: 'https://api.maptiler.com/maps/streets-v2/style.json', }, { - id: 'stamen-watercolor', - name: 'Stamen Watercolor', - type: 'leaflet', - url: 'https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.png', - attribution: - 'Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL.', + id: 'outdoor', + name: 'Outdoor', + type: 'maptiler-sdk', + url: 'https://api.maptiler.com/maps/outdoor-v2/style.json', }, ];