From 639706ebbb5cde248a88011d68ea73f0583136a9 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Mon, 5 Jun 2023 22:36:29 -0400 Subject: [PATCH 01/43] Fix build issues --- scripts/build.ts | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/scripts/build.ts b/scripts/build.ts index 8b64f162c..bbe6d03a4 100644 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -75,20 +75,8 @@ const buildWith = async ( ]); }; -export const buildContext = ( - buildOptions: BuildOptions = {} -): Promise => buildWith("context", buildOptions); - export const build = ( buildOptions: BuildOptions = {} ): Promise => buildWith("build", buildOptions); -const mainModule = pathToFileURL(process.argv[1]).toString(); -const isMain = import.meta.url === mainModule; - -if (isMain) { - await build({ - // defaults to undefined, but force it to get optimized out - define: { "window.LIVE_RELOAD": "false" }, - }); -} +await build(); From 992e3096d82221240bd64903e0cebf3670ded223 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Mon, 5 Jun 2023 22:38:54 -0400 Subject: [PATCH 02/43] Fix build errors --- scripts/build.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/build.ts b/scripts/build.ts index bbe6d03a4..95823a3bb 100644 --- a/scripts/build.ts +++ b/scripts/build.ts @@ -75,6 +75,10 @@ const buildWith = async ( ]); }; +export const buildContext = ( + buildOptions: BuildOptions = {} +): Promise => buildWith("context", buildOptions); + export const build = ( buildOptions: BuildOptions = {} ): Promise => buildWith("build", buildOptions); From fedef287bce1b50ce2b896ea59cf83a223d98a1a Mon Sep 17 00:00:00 2001 From: wmisener <58491489+wmisener@users.noreply.github.com> Date: Tue, 6 Jun 2023 12:48:48 -0700 Subject: [PATCH 03/43] Aerialway station in taginfo Adds aerialway=station to the project taginfo file --- scripts/taginfo_template.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/taginfo_template.json b/scripts/taginfo_template.json index 088e144a0..593ef945b 100644 --- a/scripts/taginfo_template.json +++ b/scripts/taginfo_template.json @@ -528,6 +528,14 @@ "doc_url": "https://openmaptiles.org/schema/#poi", "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_rail.svg" }, + { + "key": "aerialway", + "value": "station", + "object_types": ["node", "area"], + "description": "Aerialway stations are marked by an icon depicting an aerial tramway car.", + "doc_url": "https://openmaptiles.org/schema/#poi", + "icon_url": "https://raw.githubusercontent.com/ZeLonewolf/openstreetmap-americana/main/icons/poi_aerialway_circle.svg" + }, { "key": "railway", "value": "tram_stop", From 6c66866db631e712f72c14bccc7f2d893e35a0de Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 8 Jun 2023 12:17:17 -0400 Subject: [PATCH 04/43] View PR preview --- .github/workflows/deploy-preview.yml | 32 ++++++++++++++++++++++++++++ .github/workflows/deploy.yml | 6 +----- 2 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/deploy-preview.yml diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml new file mode 100644 index 000000000..1e0a16608 --- /dev/null +++ b/.github/workflows/deploy-preview.yml @@ -0,0 +1,32 @@ +name: Deploy PR Preview +on: + pull_request: + branches: [main] +permissions: + contents: read + pages: write + id-token: write +concurrency: preview-${{ github.ref }} +jobs: + build-and-deploy: + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Checkout ๐Ÿ›Ž๏ธ + uses: actions/checkout@v3 + - name: Use Node.js 18.x + uses: actions/setup-node@v3 + with: + node-version: 18.x + - name: Install and Build ๐Ÿ”ง + run: | + npm ci --include=dev + cp src/configs/config.aws.js src/config.js + npm run build + npm run style + - name: Deploy preview + uses: rossjrw/pr-preview-action@v1 + with: + source-dir: ./dist diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 070fe3877..be4438d6c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -9,6 +9,7 @@ permissions: contents: read pages: write id-token: write +concurrency: preview-${{ github.ref }} jobs: build-and-deploy: runs-on: ubuntu-latest @@ -22,11 +23,6 @@ jobs: uses: actions/setup-node@v3 with: node-version: 18.x - - name: Build Shield Library ๐Ÿ›ก๏ธ - run: | - cd shieldlib - npm ci --include=dev - npm run build - name: Install and Build ๐Ÿ”ง run: | npm ci --include=dev From f9e9e782b975608906f8390a1fcd544cb5d2068f Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 8 Jun 2023 12:32:10 -0400 Subject: [PATCH 05/43] Fix deploy permissions --- .github/workflows/deploy-preview.yml | 2 +- .github/workflows/deploy.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 1e0a16608..77583a8c1 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -5,7 +5,7 @@ on: permissions: contents: read pages: write - id-token: write + pull-requests: write concurrency: preview-${{ github.ref }} jobs: build-and-deploy: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index be4438d6c..04a9fc55c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,7 +8,6 @@ on: permissions: contents: read pages: write - id-token: write concurrency: preview-${{ github.ref }} jobs: build-and-deploy: From 15a8a7d787b0ecc739d871c204f84affaf597381 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 8 Jun 2023 12:39:43 -0400 Subject: [PATCH 06/43] Fix params and buid order --- .github/workflows/deploy-preview.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 77583a8c1..3f819dd5a 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -23,10 +23,10 @@ jobs: - name: Install and Build ๐Ÿ”ง run: | npm ci --include=dev - cp src/configs/config.aws.js src/config.js npm run build npm run style + cp src/configs/config.aws.js src/config.js - name: Deploy preview uses: rossjrw/pr-preview-action@v1 with: - source-dir: ./dist + source-dir: dist From 7de86345e513fd89e68fa901d3f67698e541f343 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 8 Jun 2023 13:02:47 -0400 Subject: [PATCH 07/43] Make mine like the example --- .github/workflows/deploy-preview.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 3f819dd5a..9d4265c7c 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -2,17 +2,19 @@ name: Deploy PR Preview on: pull_request: branches: [main] + types: + - opened + - reopened + - synchronize + - closed permissions: contents: read pages: write pull-requests: write concurrency: preview-${{ github.ref }} jobs: - build-and-deploy: + deploy-preview: runs-on: ubuntu-latest - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} steps: - name: Checkout ๐Ÿ›Ž๏ธ uses: actions/checkout@v3 @@ -29,4 +31,4 @@ jobs: - name: Deploy preview uses: rossjrw/pr-preview-action@v1 with: - source-dir: dist + source-dir: ./dist/ From f212c96ff6751cb3fcd1a552c408d8051bbe6139 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 8 Jun 2023 18:41:53 -0400 Subject: [PATCH 08/43] Update FTP deploy --- .github/workflows/deploy-preview.yml | 11 ++++++++--- .github/workflows/deploy.yml | 1 + 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 9d4265c7c..2b149ac47 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -11,6 +11,7 @@ permissions: contents: read pages: write pull-requests: write + id-token: write concurrency: preview-${{ github.ref }} jobs: deploy-preview: @@ -28,7 +29,11 @@ jobs: npm run build npm run style cp src/configs/config.aws.js src/config.js - - name: Deploy preview - uses: rossjrw/pr-preview-action@v1 + - name: Deploy via FTP + uses: genietim/ftp-action@releases/v4 with: - source-dir: ./dist/ + host: ${{ secrets.FTP_SERVER }} + user: ${{ secrets.FTP_USERNAME }} + password: ${{ secrets.FTP_PASSWORD }} + localDir: dist/ + remoteDir: pr/${{ steps.pr.outputs.pull_request_number }}/ diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 04a9fc55c..2cadb66c1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,6 +8,7 @@ on: permissions: contents: read pages: write + id-token: write concurrency: preview-${{ github.ref }} jobs: build-and-deploy: From ec362ad9173325c173f6eec876c2cf1cc8e49897 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 8 Jun 2023 18:43:15 -0400 Subject: [PATCH 09/43] Prettier --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2cadb66c1..be4438d6c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,7 +8,7 @@ on: permissions: contents: read pages: write - id-token: write + id-token: write concurrency: preview-${{ github.ref }} jobs: build-and-deploy: From e4dab3281c16913f9370417a12fbadac8f1c126d Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 8 Jun 2023 18:46:36 -0400 Subject: [PATCH 10/43] Fix package nomenclature --- .github/workflows/deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 2b149ac47..ace267e00 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -30,7 +30,7 @@ jobs: npm run style cp src/configs/config.aws.js src/config.js - name: Deploy via FTP - uses: genietim/ftp-action@releases/v4 + uses: genietim/ftp-action@v4 with: host: ${{ secrets.FTP_SERVER }} user: ${{ secrets.FTP_USERNAME }} From 3aacd33da6dfd8bbf87abddf8194a1fff7b260fb Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 8 Jun 2023 18:48:03 -0400 Subject: [PATCH 11/43] Fix version --- .github/workflows/deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index ace267e00..0aef2184f 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -30,7 +30,7 @@ jobs: npm run style cp src/configs/config.aws.js src/config.js - name: Deploy via FTP - uses: genietim/ftp-action@v4 + uses: GenieTim/ftp-action@v4.0.1 with: host: ${{ secrets.FTP_SERVER }} user: ${{ secrets.FTP_USERNAME }} From 7a6a75c32b3c628826727a157b4cc61b675e26ee Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 8 Jun 2023 18:59:00 -0400 Subject: [PATCH 12/43] Try different action --- .github/workflows/deploy-preview.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 0aef2184f..99d0efc48 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -30,10 +30,10 @@ jobs: npm run style cp src/configs/config.aws.js src/config.js - name: Deploy via FTP - uses: GenieTim/ftp-action@v4.0.1 + uses: SamKirkland/FTP-Deploy-Action@v4.3.4 with: - host: ${{ secrets.FTP_SERVER }} - user: ${{ secrets.FTP_USERNAME }} + server: ${{ secrets.FTP_SERVER }} + username: ${{ secrets.FTP_USERNAME }} password: ${{ secrets.FTP_PASSWORD }} - localDir: dist/ - remoteDir: pr/${{ steps.pr.outputs.pull_request_number }}/ + local-dir: dist/ + server-dir: pr/${{ steps.pr.outputs.pull_request_number }}/ From 27ae39e031d6118d4e0f0fc036a43e0631725095 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 8 Jun 2023 19:09:34 -0400 Subject: [PATCH 13/43] Add PR number to path --- .github/workflows/deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 99d0efc48..6ec7affb5 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -36,4 +36,4 @@ jobs: username: ${{ secrets.FTP_USERNAME }} password: ${{ secrets.FTP_PASSWORD }} local-dir: dist/ - server-dir: pr/${{ steps.pr.outputs.pull_request_number }}/ + server-dir: pr/${{ github.event.pull_request.number }}/ From 660aec1917690fb77436728d83daf69933d36ed0 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 8 Jun 2023 19:23:42 -0400 Subject: [PATCH 14/43] Cleanup FTP --- .github/workflows/deploy.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index be4438d6c..4da609a41 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -11,6 +11,16 @@ permissions: id-token: write concurrency: preview-${{ github.ref }} jobs: + cleanup-preview: + runs-on: ubuntu-latest + steps: + - name: ftp-delete-action + uses: StephanThierry/ftp-delete-action@v2.1 + with: + host: ${{ secrets.FTP_SERVER }} + user: ${{ secrets.FTP_USERNAME }} + password: ${{ secrets.FTP_PASSWORD }} + remoteDirectories: pr/${{ github.event.pull_request.number }}/ build-and-deploy: runs-on: ubuntu-latest environment: From 7efadab4da7e121fcb198a6ea97c3c18312643f5 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 8 Jun 2023 19:39:53 -0400 Subject: [PATCH 15/43] Remove big unused fonts --- .github/workflows/deploy-preview.yml | 12 ++++++++++++ scripts/fonts.json | 8 +------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 6ec7affb5..b9c80b40f 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -37,3 +37,15 @@ jobs: password: ${{ secrets.FTP_PASSWORD }} local-dir: dist/ server-dir: pr/${{ github.event.pull_request.number }}/ + - name: Comment Pull Request + uses: thollander/actions-comment-pull-request@v2.3.1 + with: + message: | + PR Preview: + * [Map](https://tile.ourmap.us/pr/${{ github.event.pull_request.number }}/) + * [Shield Test](https://tile.ourmap.us/pr/${{ github.event.pull_request.number }}/shieldtest.html) + * [Sprites 1x](https://tile.ourmap.us/pr/${{ github.event.pull_request.number }}/sprites/sprite.png) + * [Sprites 2x](https://tile.ourmap.us/pr/${{ github.event.pull_request.number }}/sprites/sprite@2x.png) + * [style.json](https://tile.ourmap.us/pr/${{ github.event.pull_request.number }}/style.json) + * [taginfo.json](https://tile.ourmap.us/pr/${{ github.event.pull_request.number }}/taginfo.json) + comment_tag: pr_preview diff --git a/scripts/fonts.json b/scripts/fonts.json index a0e89ef2f..981a5c437 100644 --- a/scripts/fonts.json +++ b/scripts/fonts.json @@ -31,13 +31,7 @@ "Noto Sans Telugu": ["regular", "700"], "Noto Sans Thai": ["regular", "700"] }, - "bundle-font-stacks": { - "Noto Sans HK": ["regular", "700"], - "Noto Sans JP": ["regular", "700"], - "Noto Sans KR": ["regular", "700"], - "Noto Sans SC": ["regular", "700"], - "Noto Sans TC": ["regular", "700"] - }, + "bundle-font-stacks": {}, "glyph-ranges": { "arabic": [ [1536, 1791], From 04992d51bcaa62045f89364caaf521843c99a564 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 8 Jun 2023 20:01:26 -0400 Subject: [PATCH 16/43] Update preview URL --- .github/workflows/deploy-preview.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index b9c80b40f..a0c93127f 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -6,7 +6,6 @@ on: - opened - reopened - synchronize - - closed permissions: contents: read pages: write @@ -29,6 +28,13 @@ jobs: npm run build npm run style cp src/configs/config.aws.js src/config.js + - name: ftp-delete-action + uses: StephanThierry/ftp-delete-action@v2.1 + with: + host: ${{ secrets.FTP_SERVER }} + user: ${{ secrets.FTP_USERNAME }} + password: ${{ secrets.FTP_PASSWORD }} + remoteDirectories: pr/${{ github.event.pull_request.number }}/ - name: Deploy via FTP uses: SamKirkland/FTP-Deploy-Action@v4.3.4 with: @@ -42,10 +48,10 @@ jobs: with: message: | PR Preview: - * [Map](https://tile.ourmap.us/pr/${{ github.event.pull_request.number }}/) - * [Shield Test](https://tile.ourmap.us/pr/${{ github.event.pull_request.number }}/shieldtest.html) - * [Sprites 1x](https://tile.ourmap.us/pr/${{ github.event.pull_request.number }}/sprites/sprite.png) - * [Sprites 2x](https://tile.ourmap.us/pr/${{ github.event.pull_request.number }}/sprites/sprite@2x.png) - * [style.json](https://tile.ourmap.us/pr/${{ github.event.pull_request.number }}/style.json) - * [taginfo.json](https://tile.ourmap.us/pr/${{ github.event.pull_request.number }}/taginfo.json) + * [Map](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/) + * [Shield Test](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/shieldtest.html) + * [Sprites 1x](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/sprites/sprite.png) + * [Sprites 2x](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/sprites/sprite@2x.png) + * [style.json](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/style.json) + * [taginfo.json](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/taginfo.json) comment_tag: pr_preview From cde05b700b0200923f64c39d44876c9675d9b458 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 8 Jun 2023 20:04:23 -0400 Subject: [PATCH 17/43] Improve comment text --- .github/workflows/deploy-preview.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index a0c93127f..d08bc6864 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -50,8 +50,8 @@ jobs: PR Preview: * [Map](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/) * [Shield Test](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/shieldtest.html) - * [Sprites 1x](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/sprites/sprite.png) - * [Sprites 2x](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/sprites/sprite@2x.png) * [style.json](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/style.json) * [taginfo.json](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/taginfo.json) + * ![Sprites 1x][https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/sprites/sprite.png] + * ![Sprites 2x][https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/sprites/sprite@2x.png] comment_tag: pr_preview From ec7440fc5f9eb61cffaa5820b11c7a6d8a7d97e3 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 8 Jun 2023 20:11:08 -0400 Subject: [PATCH 18/43] Improve CI labels --- .github/workflows/deploy-preview.yml | 2 +- .github/workflows/deploy.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index d08bc6864..28beb816a 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -28,7 +28,7 @@ jobs: npm run build npm run style cp src/configs/config.aws.js src/config.js - - name: ftp-delete-action + - name: Remove prior FTP preview uses: StephanThierry/ftp-delete-action@v2.1 with: host: ${{ secrets.FTP_SERVER }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4da609a41..98338e5a0 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,7 +14,7 @@ jobs: cleanup-preview: runs-on: ubuntu-latest steps: - - name: ftp-delete-action + - name: Remove prior FTP preview uses: StephanThierry/ftp-delete-action@v2.1 with: host: ${{ secrets.FTP_SERVER }} From 815ff8dce266351400755977b50d577cac44cd3a Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 8 Jun 2023 20:16:21 -0400 Subject: [PATCH 19/43] Clean folder --- .github/workflows/deploy-preview.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 28beb816a..5209ee807 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -43,6 +43,7 @@ jobs: password: ${{ secrets.FTP_PASSWORD }} local-dir: dist/ server-dir: pr/${{ github.event.pull_request.number }}/ + dangerous-clean-slate: true - name: Comment Pull Request uses: thollander/actions-comment-pull-request@v2.3.1 with: From 43b67da8b893a9bae43c649cef6a62c63e265354 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 8 Jun 2023 22:27:19 -0400 Subject: [PATCH 20/43] Fix broken images --- .github/workflows/deploy-preview.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 5209ee807..c856569e4 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -53,6 +53,7 @@ jobs: * [Shield Test](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/shieldtest.html) * [style.json](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/style.json) * [taginfo.json](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/taginfo.json) - * ![Sprites 1x][https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/sprites/sprite.png] - * ![Sprites 2x][https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/sprites/sprite@2x.png] + Sprite Sheets: + ![Sprites 1x](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/sprites/sprite.png) + ![Sprites 2x](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/sprites/sprite@2x.png) comment_tag: pr_preview From 0572953e2af1291b011c0874279692f2dcbc0e1e Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 8 Jun 2023 22:44:52 -0400 Subject: [PATCH 21/43] Add line breaks --- .github/workflows/deploy-preview.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index c856569e4..11da911ff 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -53,7 +53,9 @@ jobs: * [Shield Test](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/shieldtest.html) * [style.json](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/style.json) * [taginfo.json](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/taginfo.json) + Sprite Sheets: + ![Sprites 1x](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/sprites/sprite.png) ![Sprites 2x](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/sprites/sprite@2x.png) comment_tag: pr_preview From 87d28ce578737445f4fb397b9c16ac0f1d377379 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 10 Jun 2023 19:01:24 -0400 Subject: [PATCH 22/43] Fix legend hookup --- shieldlib/src/shield_renderer.ts | 19 +++++++ src/americana.js | 96 +++++++++++++++++--------------- src/js/legend_control.js | 9 ++- 3 files changed, 76 insertions(+), 48 deletions(-) diff --git a/shieldlib/src/shield_renderer.ts b/shieldlib/src/shield_renderer.ts index 42b0452ac..1f421dc3a 100644 --- a/shieldlib/src/shield_renderer.ts +++ b/shieldlib/src/shield_renderer.ts @@ -61,6 +61,7 @@ class AbstractShieldRenderer { private _networkPredicate: StringPredicate = () => true; private _routeParser: RouteParser; private _renderContext: ShieldRenderingContext; + private _shieldDefCallbacks = []; constructor(routeParser: RouteParser) { this._routeParser = routeParser; @@ -71,6 +72,13 @@ class AbstractShieldRenderer { protected setShields(shieldSpec: ShieldSpecification) { this._renderContext.options = shieldSpec.options; this._renderContext.shieldDef = shieldSpec.networks; + this._shieldDefCallbacks.forEach((callback) => + callback(shieldSpec.networks) + ); + } + + public getShieldDefinitions(): ShieldDefinitions { + return this._renderContext.shieldDef; } public debugOptions(debugOptions: DebugOptions): AbstractShieldRenderer { @@ -103,6 +111,17 @@ class AbstractShieldRenderer { return this; } + public onShieldDefLoad( + callback: (shields: ShieldDefinitions) => void + ): AbstractShieldRenderer { + if (this._renderContext.shieldDef) { + callback(this._renderContext.shieldDef); + } else { + this._shieldDefCallbacks.push(callback); + } + return this; + } + public renderOnRepository(repo: SpriteRepository): AbstractShieldRenderer { if (!this._renderContext.spriteRepo) { this._renderContext.spriteRepo = repo; diff --git a/src/americana.js b/src/americana.js index cd52c7cc0..0bbff2f9f 100644 --- a/src/americana.js +++ b/src/americana.js @@ -68,10 +68,60 @@ if (config.SHIELD_TEXT_HALO_COLOR_OVERRIDE) { config.SHIELD_TEXT_HALO_COLOR_OVERRIDE; } +// Add our sample data. +let sampleControl = new SampleControl({ permalinks: true }); +OpenMapTilesSamples.forEach((sample, i) => { + sampleControl.addSample(sample); +}); + +let legendControl; + const shieldRenderer = new URLShieldRenderer("shields.json", routeParser) .filterImageID(shieldPredicate) .filterNetwork(networkPredicate) - .renderOnMaplibreGL(map); + .renderOnMaplibreGL(map) + .onShieldDefLoad((shields) => shieldDefLoad(shields)); + +function shieldDefLoad(shields) { + + legendControl = new LegendControl(shields); + legendControl.sections = LegendConfig.sections; + map.addControl(legendControl, "bottom-left"); + map.addControl(sampleControl, "bottom-left"); + + map.getCanvas().focus(); + + map.addControl(new maplibregl.AttributionControl(attributionConfig)); + map.addControl(languageLabel.label, "bottom-right"); + + map.addControl(new search.PhotonSearchControl(), "top-left"); + map.addControl(new maplibregl.NavigationControl(), "top-left"); + + window.addEventListener("languagechange", (event) => { + console.log(`Changed to ${navigator.languages}`); + hotReloadMap(); + updateLanguageLabel(); + }); + + window.addEventListener("hashchange", (event) => { + upgradeLegacyHash(); + let oldLanguage = Label.getLanguageFromURL(new URL(event.oldURL)); + let newLanguage = Label.getLanguageFromURL(new URL(event.newURL)); + if (oldLanguage !== newLanguage) { + console.log(`Changed to ${newLanguage}`); + hotReloadMap(); + updateLanguageLabel(); + } + }); + + updateLanguageLabel(); + + if (window.LIVE_RELOAD) { + new EventSource("/esbuild").addEventListener("change", () => + location.reload() + ); + } +} map.on("styleimagemissing", function (e) { switch (e.id.split("\n")[0]) { @@ -95,25 +145,6 @@ export function updateLanguageLabel() { legendControl.onLanguageChange(); } -let legendControl = new LegendControl(); -legendControl.sections = LegendConfig.sections; -window.addEventListener("languagechange", (event) => { - console.log(`Changed to ${navigator.languages}`); - hotReloadMap(); - updateLanguageLabel(); -}); - -window.addEventListener("hashchange", (event) => { - upgradeLegacyHash(); - let oldLanguage = Label.getLanguageFromURL(new URL(event.oldURL)); - let newLanguage = Label.getLanguageFromURL(new URL(event.newURL)); - if (oldLanguage !== newLanguage) { - console.log(`Changed to ${newLanguage}`); - hotReloadMap(); - updateLanguageLabel(); - } -}); - let attributionConfig = { customAttribution: "", }; @@ -124,32 +155,7 @@ if (config.ATTRIBUTION_TEXT != undefined) { }; } -map.addControl(new maplibregl.AttributionControl(attributionConfig)); -map.addControl(languageLabel.label, "bottom-right"); - if (config.ATTRIBUTION_LOGO != undefined) { document.getElementById("attribution-logo").innerHTML = config.ATTRIBUTION_LOGO; } - -map.addControl(new search.PhotonSearchControl(), "top-left"); -map.addControl(new maplibregl.NavigationControl(), "top-left"); - -map.addControl(legendControl, "bottom-left"); - -// Add our sample data. -let sampleControl = new SampleControl({ permalinks: true }); -OpenMapTilesSamples.forEach((sample, i) => { - sampleControl.addSample(sample); -}); -map.addControl(sampleControl, "bottom-left"); - -map.getCanvas().focus(); - -updateLanguageLabel(); - -if (window.LIVE_RELOAD) { - new EventSource("/esbuild").addEventListener("change", () => - location.reload() - ); -} diff --git a/src/js/legend_control.js b/src/js/legend_control.js index a380265bd..3ff1905a1 100644 --- a/src/js/legend_control.js +++ b/src/js/legend_control.js @@ -2,7 +2,6 @@ import { getDOMPixelRatio } from "@americana/maplibre-shield-generator"; import * as Label from "../constants/label.js"; -import * as ShieldDef from "./shield_defs.js"; import * as HighwayShieldLayers from "../layer/highway_shield.js"; @@ -20,6 +19,10 @@ function toSentenceCase(lowerCase, locale) { } export default class LegendControl { + constructor(shieldDefs) { + this._shieldDefs = shieldDefs; + } + onAdd(map) { this._map = map; @@ -467,7 +470,7 @@ export default class LegendControl { } let networkImages = imagesByNetwork[image.network]; - let shieldDef = ShieldDef.shields[image.network]; + let shieldDef = this._shieldDefs[image.network]; if (image.ref && shieldDef?.overrideByRef?.[image.ref]) { // Store a different image for each override in the shield definition. if (!networkImages.overridesByRef[image.ref]) { @@ -505,7 +508,7 @@ export default class LegendControl { // order as in the shield definitions, appending all the unrecognized // networks sorted in alphabetical order. let networks = [ - ...Object.keys(ShieldDef.shields), + ...Object.keys(this._shieldDefs), ...[...unrecognizedNetworks.values()].sort(), ]; let countries = new Set(); From 99ae210cfe55f60bd8bd446ef5114cbdc1a46663 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 10 Jun 2023 19:10:28 -0400 Subject: [PATCH 23/43] Prettier --- src/americana.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/americana.js b/src/americana.js index 0bbff2f9f..b4d7188b7 100644 --- a/src/americana.js +++ b/src/americana.js @@ -83,7 +83,6 @@ const shieldRenderer = new URLShieldRenderer("shields.json", routeParser) .onShieldDefLoad((shields) => shieldDefLoad(shields)); function shieldDefLoad(shields) { - legendControl = new LegendControl(shields); legendControl.sections = LegendConfig.sections; map.addControl(legendControl, "bottom-left"); From ba5ae764606319b3519ba00b5e338b97e80cdf93 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Mon, 12 Jun 2023 19:45:23 -0400 Subject: [PATCH 24/43] Add tile usage policy --- README.md | 4 ++++ TILE_USAGE.md | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 TILE_USAGE.md diff --git a/README.md b/README.md index b551ae403..41e0622c5 100644 --- a/README.md +++ b/README.md @@ -68,3 +68,7 @@ Americana displays custom route shields for routes in all U.S. states and territ Countries We are hoping that it will support more countries; you can [help us](https://github.com/ZeLonewolf/openstreetmap-americana/projects/1)! + +## Tile Server + +Americana's GitHub map uses a privately-donated community [tile server](https://tile.ourmap.us). It is available for use by other hobbyist and community projects. See also the [tile server usage policy](TILE_USAGE.md). diff --git a/TILE_USAGE.md b/TILE_USAGE.md new file mode 100644 index 000000000..1cd437ab8 --- /dev/null +++ b/TILE_USAGE.md @@ -0,0 +1,41 @@ +# Tile Usage Policy + +Tile Usage Policy for OpenStreetMap Americana Community Vector Tile Server + +**Effective Date: June 12, 2023** + +Thank you for using the OpenStreetMap Americana [Community Vector Tile Server](https://tile.ourmap.us) (referred to as "the Server"). By accessing and using the tiles provided by the Server, you agree to comply with the following Tile Usage Policy: + +1. Purpose: + The Server aims to support hobbyists, small community groups, and individuals who require vector tiles for their projects or development of custom map styles. The Server is a community resource provided at no cost, but limitations may apply based on server capacity and financial constraints. + +2. Attribution: + When using tiles from the Server, you must provide proper attribution to OpenStreetMap and OpenMapTiles as required by their respective attribution policies. + +3. Personal and Non-Commercial Use: + The Server is primarily intended for personal, non-commercial use. You are welcome to use the tiles for personal or community projects, educational purposes, or non-profit initiatives that do not generate revenue. There are several [guides](https://www.openstreetmap.org/user/ZeLonewolf/diary/401697) available for commercial users that desire to run a vector tile server at low cost. + +4. Domain Whitelisting: + Tile usage from localhost and \*.github.io is permitted, which are common ways that most developers will access the tile server when starting a new project. If you wish to use the tiles under your own domain name, please contact the Americana team on [Slack](https://osmus.slack.com/archives/C01V02K52UX) (preferred) or [GitHub](https://github.com/ZeLonewolf/openstreetmap-americana) and provide your domain name(s) in order to add your domain to the CORS (Cross-Origin Resource Sharing) white list. This will allow you to fetch tiles directly from your domain. This whitelist is subject to the discretion and may be modified or removed at any time, however, permission is routinely given for community and hobby projects. + +5. Usage Limits: + To ensure fair usage and prevent abuse, the Server may enforce limits on tile requests for individual users or domains. If your usage exceeds reasonable levels or begins to strain the server's resources, the administrator reserves the right to restrict or terminate access to the Server. Users whose usage becomes excessive may be requested to set up their own tile server. + +6. Financial Considerations: + The Server is operated on a limited budget and funded out of pocket by the administrator. While it strives to be freely accessible, financial constraints may necessitate restrictions on usage. If the costs associated with providing tiles become prohibitive, the administrator may need to limit or suspend service temporarily or permanently. Users who can afford to host their own tile server are encouraged to do so. + +7. No Guarantees: + The Server is provided on an "as-is" basis, and no guarantees or warranties are offered regarding its availability, performance, or accuracy of the tiles. The administrator will make reasonable efforts to maintain the service, but interruptions or downtime may occur due to various factors beyond their control. + +8. Modifications and Termination: + The administrator reserves the right to modify or terminate the Server or this Tile Usage Policy at any time without prior notice. The administrator may also modify or update the CORS white list as needed. + +9. Compliance with OpenStreetMap Guidelines: + All users of the Server are expected to comply with the OpenStreetMap licensing terms, guidelines, and community norms. Additionally, the OpenStreetMap Americana project has adopted the OpenStreetMap US Code of Conduct, which applies where applicable. Any violation of these terms may result in the immediate termination of access to the Server. + +10. Feedback and Support: + The administrator appreciates feedback, bug reports, and suggestions to improve the Server via [Slack](https://osmus.slack.com/archives/C01V02K52UX) or [GitHub]. However, support resources may be limited. Users are encouraged to seek assistance from the OpenStreetMap community or other relevant forums for additional support. + +By using the tiles provided by the OpenStreetMap Americana Community Vector Tile Server, you acknowledge and agree to the terms outlined in this Tile Usage Policy. Failure to comply with these terms may result in the revocation of access to the Server. + +Please note that this Tile Usage Policy is subject to change at any time and for any reason. From 0338f949284b83c1571d8d903db69053e407a585 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Mon, 12 Jun 2023 20:03:42 -0400 Subject: [PATCH 25/43] Prettier --- TILE_USAGE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TILE_USAGE.md b/TILE_USAGE.md index 1cd437ab8..e3b33944d 100644 --- a/TILE_USAGE.md +++ b/TILE_USAGE.md @@ -7,7 +7,7 @@ Tile Usage Policy for OpenStreetMap Americana Community Vector Tile Server Thank you for using the OpenStreetMap Americana [Community Vector Tile Server](https://tile.ourmap.us) (referred to as "the Server"). By accessing and using the tiles provided by the Server, you agree to comply with the following Tile Usage Policy: 1. Purpose: - The Server aims to support hobbyists, small community groups, and individuals who require vector tiles for their projects or development of custom map styles. The Server is a community resource provided at no cost, but limitations may apply based on server capacity and financial constraints. + The Server aims to support hobbyists, small community groups, and individuals who require vector tiles for their projects or development of custom map styles. The Server is a community resource provided at no cost, but limitations may apply based on server capacity and financial constraints. 2. Attribution: When using tiles from the Server, you must provide proper attribution to OpenStreetMap and OpenMapTiles as required by their respective attribution policies. From 729360878989f237f255464ed705ea5724a67b01 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Mon, 12 Jun 2023 20:46:10 -0400 Subject: [PATCH 26/43] Update TILE_USAGE.md Co-authored-by: Ariel Kadouri --- TILE_USAGE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TILE_USAGE.md b/TILE_USAGE.md index e3b33944d..0891d7bab 100644 --- a/TILE_USAGE.md +++ b/TILE_USAGE.md @@ -10,7 +10,7 @@ Thank you for using the OpenStreetMap Americana [Community Vector Tile Server](h The Server aims to support hobbyists, small community groups, and individuals who require vector tiles for their projects or development of custom map styles. The Server is a community resource provided at no cost, but limitations may apply based on server capacity and financial constraints. 2. Attribution: - When using tiles from the Server, you must provide proper attribution to OpenStreetMap and OpenMapTiles as required by their respective attribution policies. + When using tiles from the Server, you must provide proper attribution to [OpenStreetMap](https://wiki.osmfoundation.org/wiki/Licence/Attribution_Guidelines#OpenStreetMap_Attribution_Guideline) and [OpenMapTiles](https://github.com/openmaptiles/openmaptiles/blob/master/LICENSE.md) as required by their respective attribution policies. 3. Personal and Non-Commercial Use: The Server is primarily intended for personal, non-commercial use. You are welcome to use the tiles for personal or community projects, educational purposes, or non-profit initiatives that do not generate revenue. There are several [guides](https://www.openstreetmap.org/user/ZeLonewolf/diary/401697) available for commercial users that desire to run a vector tile server at low cost. From ca102f17b3e71106eb86ea7f926152ff7f595c76 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Mon, 12 Jun 2023 20:48:26 -0400 Subject: [PATCH 27/43] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 41e0622c5..94a7889d4 100644 --- a/README.md +++ b/README.md @@ -71,4 +71,4 @@ We are hoping that it will support more countries; you can [help us](https://git ## Tile Server -Americana's GitHub map uses a privately-donated community [tile server](https://tile.ourmap.us). It is available for use by other hobbyist and community projects. See also the [tile server usage policy](TILE_USAGE.md). +Americana's GitHub map uses a privately-donated community [tile server](https://tile.ourmap.us). It is available for use by other hobbyist and community projects. See also the [tile server usage policy](TILE_USAGE.md). The usage policy describes the allowable usage of the tiles, irrespective of use of the style or application being developed in this repository. From 2b3ae8761bd38e9d531914ef9932d74a8449ad8a Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Mon, 12 Jun 2023 20:51:15 -0400 Subject: [PATCH 28/43] Update TILE_USAGE.md --- TILE_USAGE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TILE_USAGE.md b/TILE_USAGE.md index 0891d7bab..6b818ca57 100644 --- a/TILE_USAGE.md +++ b/TILE_USAGE.md @@ -13,7 +13,7 @@ Thank you for using the OpenStreetMap Americana [Community Vector Tile Server](h When using tiles from the Server, you must provide proper attribution to [OpenStreetMap](https://wiki.osmfoundation.org/wiki/Licence/Attribution_Guidelines#OpenStreetMap_Attribution_Guideline) and [OpenMapTiles](https://github.com/openmaptiles/openmaptiles/blob/master/LICENSE.md) as required by their respective attribution policies. 3. Personal and Non-Commercial Use: - The Server is primarily intended for personal, non-commercial use. You are welcome to use the tiles for personal or community projects, educational purposes, or non-profit initiatives that do not generate revenue. There are several [guides](https://www.openstreetmap.org/user/ZeLonewolf/diary/401697) available for commercial users that desire to run a vector tile server at low cost. + The Server is primarily intended for personal, non-commercial use. You are welcome to use the tiles for personal or community projects, educational purposes, or non-profit initiatives that do not generate revenue. There are several [guides](https://www.openstreetmap.org/user/ZeLonewolf/diary/401697) available for commercial users that desire to run a vector tile server at low cost. Note that this policy only applies to the tile server usage. Anyone is free to use the OSM Americana on their own tile server, even for a commercial endeavor. 4. Domain Whitelisting: Tile usage from localhost and \*.github.io is permitted, which are common ways that most developers will access the tile server when starting a new project. If you wish to use the tiles under your own domain name, please contact the Americana team on [Slack](https://osmus.slack.com/archives/C01V02K52UX) (preferred) or [GitHub](https://github.com/ZeLonewolf/openstreetmap-americana) and provide your domain name(s) in order to add your domain to the CORS (Cross-Origin Resource Sharing) white list. This will allow you to fetch tiles directly from your domain. This whitelist is subject to the discretion and may be modified or removed at any time, however, permission is routinely given for community and hobby projects. From d57b3d1e43c7412231fa543afce522caeb4a8689 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Mon, 12 Jun 2023 20:53:59 -0400 Subject: [PATCH 29/43] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 94a7889d4..afb8600de 100644 --- a/README.md +++ b/README.md @@ -71,4 +71,4 @@ We are hoping that it will support more countries; you can [help us](https://git ## Tile Server -Americana's GitHub map uses a privately-donated community [tile server](https://tile.ourmap.us). It is available for use by other hobbyist and community projects. See also the [tile server usage policy](TILE_USAGE.md). The usage policy describes the allowable usage of the tiles, irrespective of use of the style or application being developed in this repository. +While the source code in this repository remains dedicated to the public domain under a CC0 waiver, Americana's GitHub map uses a privately-donated community [tile server](https://tile.ourmap.us) to run the live map. This server is available for use by other hobbyist and community projects with constraints. See the [tile server usage policy](TILE_USAGE.md) for more details. This usage policy describes the allowable usage of the tiles for other projects, separate from this style or the application being developed in this repository. From 705de0bcd361abdac363666272f8d54fa93ae63d Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Mon, 12 Jun 2023 21:11:44 -0400 Subject: [PATCH 30/43] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Minh Nguyแป…n --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index afb8600de..60dbaef55 100644 --- a/README.md +++ b/README.md @@ -71,4 +71,4 @@ We are hoping that it will support more countries; you can [help us](https://git ## Tile Server -While the source code in this repository remains dedicated to the public domain under a CC0 waiver, Americana's GitHub map uses a privately-donated community [tile server](https://tile.ourmap.us) to run the live map. This server is available for use by other hobbyist and community projects with constraints. See the [tile server usage policy](TILE_USAGE.md) for more details. This usage policy describes the allowable usage of the tiles for other projects, separate from this style or the application being developed in this repository. +Although the source code in this repository is dedicated to the public domain under a CC0 waiver, it is configured by default to load map tiles from a privately-donated community [tile server](https://tile.ourmap.us). This server is available for use by other hobbyist and community projects with constraints. See the [tile server usage policy](TILE_USAGE.md) for more details. This usage policy describes the allowable usage of the tiles for other projects, separate from this style or the application being developed in this repository. From eb1c75c8255120aab707a2b7adfd565de4edf181 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Mon, 12 Jun 2023 21:17:11 -0400 Subject: [PATCH 31/43] Link to options for running a tile server --- CONTRIBUTING.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 741ba9918..fedb229cd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -127,6 +127,10 @@ server which is beyond the scope of this guide. [20]: https://cloud.maptiler.com/maps/ [21]: https://openmaptiles.org/schema/ +### Running your own tile server + +For production usages, consider running your own tile server. Thanks to advances in technology, it is possible to run an OpenMapTiles tile server for a modest cost. See the diary entry [Host an OpenMapTiles Vector Tile Server on AWS for $19.75/month](https://www.openstreetmap.org/user/ZeLonewolf/diary/401697) for more details. + ## Running the Americana style ### In development... From 44731dca8da172335789de4d434460c51d6197ec Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Wed, 14 Jun 2023 14:31:05 -0400 Subject: [PATCH 32/43] Fix status map --- scripts/status_map.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/status_map.js b/scripts/status_map.js index 256bccc8f..ba50f5327 100644 --- a/scripts/status_map.js +++ b/scripts/status_map.js @@ -24,7 +24,7 @@ let worldSVG = fs.readFileSync(`${process.cwd()}/scripts/blank_map_world.svg`, { }); worldSVG = fillPaths( worldSVG, - Object.keys(shields) + Object.keys(shields.networks) .map((network) => network.match(/^(\w\w)(?::|$)|^omt-(\w\w)-/)) .filter((m) => m) .map((m) => m[1] || m[2]) From 26f6abf6034cc46d836d693475dfa446f61d1a3f Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 17 Jun 2023 15:47:12 -0400 Subject: [PATCH 33/43] Prior preview removal not needed --- .github/workflows/deploy-preview.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 11da911ff..508171b3c 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -28,13 +28,6 @@ jobs: npm run build npm run style cp src/configs/config.aws.js src/config.js - - name: Remove prior FTP preview - uses: StephanThierry/ftp-delete-action@v2.1 - with: - host: ${{ secrets.FTP_SERVER }} - user: ${{ secrets.FTP_USERNAME }} - password: ${{ secrets.FTP_PASSWORD }} - remoteDirectories: pr/${{ github.event.pull_request.number }}/ - name: Deploy via FTP uses: SamKirkland/FTP-Deploy-Action@v4.3.4 with: From f30f37224cfb5bb2e7db5bc15b5a6597caa298cd Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 17 Jun 2023 17:07:19 -0400 Subject: [PATCH 34/43] Move from FTP to s3 --- .github/workflows/deploy-preview.yml | 18 ++++++++++-------- .github/workflows/deploy.yml | 11 +---------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 508171b3c..d81c88db4 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -28,15 +28,17 @@ jobs: npm run build npm run style cp src/configs/config.aws.js src/config.js - - name: Deploy via FTP - uses: SamKirkland/FTP-Deploy-Action@v4.3.4 + - name: Deploy via S3 + uses: jakejarvis/s3-sync-action@master with: - server: ${{ secrets.FTP_SERVER }} - username: ${{ secrets.FTP_USERNAME }} - password: ${{ secrets.FTP_PASSWORD }} - local-dir: dist/ - server-dir: pr/${{ github.event.pull_request.number }}/ - dangerous-clean-slate: true + args: --acl public-read --follow-symlinks --delete --exclude '.git/*' --exclude '.github/*' + env: + AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_REGION: ${{ secrets.AWS_REGION }} + SOURCE_DIR: "./dist" + DEST_DIR: pr/${{ github.event.pull_request.number }}/ - name: Comment Pull Request uses: thollander/actions-comment-pull-request@v2.3.1 with: diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 98338e5a0..d7afb87c9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -11,16 +11,7 @@ permissions: id-token: write concurrency: preview-${{ github.ref }} jobs: - cleanup-preview: - runs-on: ubuntu-latest - steps: - - name: Remove prior FTP preview - uses: StephanThierry/ftp-delete-action@v2.1 - with: - host: ${{ secrets.FTP_SERVER }} - user: ${{ secrets.FTP_USERNAME }} - password: ${{ secrets.FTP_PASSWORD }} - remoteDirectories: pr/${{ github.event.pull_request.number }}/ + # TODO remove old PRs from s3 bucket automatically build-and-deploy: runs-on: ubuntu-latest environment: From 00d7676c18962bdb6f7a7ad9b6a33fc6668e2b55 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 17 Jun 2023 20:00:37 -0400 Subject: [PATCH 35/43] Remove trailing slash --- .github/workflows/deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index d81c88db4..d898588be 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -38,7 +38,7 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_REGION: ${{ secrets.AWS_REGION }} SOURCE_DIR: "./dist" - DEST_DIR: pr/${{ github.event.pull_request.number }}/ + DEST_DIR: pr/${{ github.event.pull_request.number }} - name: Comment Pull Request uses: thollander/actions-comment-pull-request@v2.3.1 with: From 15be76d96c8fad16b5536076a82b6ee2d4242a8d Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 17 Jun 2023 20:18:06 -0400 Subject: [PATCH 36/43] Fix trailing slashes from URL --- src/americana.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/americana.js b/src/americana.js index b4d7188b7..bd64f0e32 100644 --- a/src/americana.js +++ b/src/americana.js @@ -26,7 +26,9 @@ import { export function buildStyle() { var getUrl = window.location; - var baseUrl = getUrl.protocol + "//" + getUrl.host + getUrl.pathname; + var baseUrl = (getUrl.protocol + "//" + getUrl.host + getUrl.pathname) + //Trim trailing slashes from URL + .replace(/\/+$/, ""); return Style.build( config.OPENMAPTILES_URL, `${baseUrl}/sprites/sprite`, From 111c77b90d905eb3dbda41e5224c39cef51196ac Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 17 Jun 2023 21:00:20 -0400 Subject: [PATCH 37/43] Add shields.json generation --- .github/workflows/deploy-preview.yml | 1 + .github/workflows/deploy.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index d898588be..f38dcdb1b 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -27,6 +27,7 @@ jobs: npm ci --include=dev npm run build npm run style + npm run shields cp src/configs/config.aws.js src/config.js - name: Deploy via S3 uses: jakejarvis/s3-sync-action@master diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index d7afb87c9..442069519 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -30,6 +30,7 @@ jobs: cp src/configs/config.aws.js src/config.js npm run build npm run style + npm run shields - name: Upload ๐Ÿ— uses: actions/upload-pages-artifact@v1 with: From 2ec120def7251aba36d958236b0ec7699993bf8e Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sat, 17 Jun 2023 21:00:53 -0400 Subject: [PATCH 38/43] Add shields.json to comment --- .github/workflows/deploy-preview.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index f38dcdb1b..d63c562da 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -48,6 +48,7 @@ jobs: * [Map](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/) * [Shield Test](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/shieldtest.html) * [style.json](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/style.json) + * [shields.json](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/shields.json) * [taginfo.json](https://preview.ourmap.us/pr/${{ github.event.pull_request.number }}/taginfo.json) Sprite Sheets: From 46ac8a9aa3c7726a200608b37488b9fe6db39321 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sun, 18 Jun 2023 08:25:23 -0400 Subject: [PATCH 39/43] Migrate fonts to fontstack66 --- CONTRIBUTING.md | 4 + package.json | 7 +- scripts/FONTS.md | 8 - scripts/fonts.js | 168 ----------- scripts/fonts.json | 610 -------------------------------------- scripts/generate_style.js | 2 +- scripts/stats.js | 2 +- src/americana.js | 2 +- 8 files changed, 9 insertions(+), 794 deletions(-) delete mode 100644 scripts/FONTS.md delete mode 100644 scripts/fonts.js delete mode 100644 scripts/fonts.json diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 741ba9918..8f9e85dd9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -380,3 +380,7 @@ For consistency, POI icons use the following color palette: | Airport | Medium Purple C | Purple | 78 0 142 | #4e008e | | Transport | Pantone 234 C | Mauve | 162 0 103 | #a20067 | | Knockout | | Lt Grayish Orange | 249 245 240 | #f9f5f0 | + +## Fonts + +Fonts for style labels are packaged and defined in [fontstack66](https://github.com/osm-americana/fontstack66), Americana's font package. \ No newline at end of file diff --git a/package.json b/package.json index 616704c17..39f528311 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "scripts": { "build:shieldlib": "cd shieldlib && node scripts/build.js", "build:code": "exec ts-node scripts/build", - "build": "run-s clean-build sprites fonts build:shieldlib build:code taginfo status_map", + "build": "run-s clean-build sprites build:shieldlib build:code taginfo status_map", "clean": "run-s clean:shieldlib clean:code clean-download clean-build", "clean-download": "shx rm -rf download", "clean-build": "shx rm -rf dist build", @@ -23,14 +23,11 @@ "code_format": "run-s code_format:prettier code_format:svgo", "code_format:prettier": "prettier --write --list-different .", "code_format:svgo": "svgo -q -f icons/", - "fonts:install_glyph_builder": "cargo install build_pbf_glyphs@1.3.0", - "fonts:build": "node scripts/fonts", - "fonts": "run-s fonts:install_glyph_builder fonts:build", "presprites": "shx rm -rf dist/sprites", "serve": "ts-node scripts/serve", "shields": "node scripts/generate_shield_defs.js -o dist/shields.json", "sprites": "node scripts/sprites.js", - "start": "run-s clean-build build:shieldlib sprites fonts shields serve", + "start": "run-s clean-build build:shieldlib sprites shields serve", "stats": "node scripts/stats.js", "style": "node scripts/generate_style.js -o dist/style.json", "status_map": "node scripts/status_map.js", diff --git a/scripts/FONTS.md b/scripts/FONTS.md deleted file mode 100644 index 7d577a345..000000000 --- a/scripts/FONTS.md +++ /dev/null @@ -1,8 +0,0 @@ -The Americana fontstack is built from [Google Fonts](https://fonts.google.com/). - -In order to add fontstack support, modify the `fonts.json` file as follows: - -1. Add font-family and variant information to the `font-families` section. The font-family is the name of the font as listed on Google Fonts, e.g. "Noto Sans". Use `gfi download ""` to get a full list of the variants. The variant is everything to the right of the dash in the filename, so if a file is named `NotoSans-700.ttf`, the variant is `700`, though it will be listed in Google as something like "Bold 700". The `gfi` command requires you to install the `google-font-installer` package into npm with `npm install -g google-font-installer`. -2. Define the range of characters that you want rendered in this font in the `glyph-ranges` section. Since this is JSON, you'll have to convert hex to decimal here. The named parameter is simply a name that is used in the rest of the file to refer to this range of characters. This is an _inclusive_ range so for example `[0, 255]` will include codepoint 0 and codepoint 255. -3. The `custom-font-stacks` section lists each font-stack and which font/glyph range combinations should be included in that fontstack. -4. The `bundle-font-stacks` section lists all font stacks which should be bundled in their original form. diff --git a/scripts/fonts.js b/scripts/fonts.js deleted file mode 100644 index 1b962d2d7..000000000 --- a/scripts/fonts.js +++ /dev/null @@ -1,168 +0,0 @@ -// read font file -import { Font } from "fonteditor-core"; -import fs from "fs"; -import { execSync } from "child_process"; -import { promisify } from "util"; -import { exec } from "child_process"; -import path from "path"; - -function createRangeArray(start, end) { - return Array.from({ length: end - start + 1 }, (_, i) => start + i); -} - -function countFilesMatchingRegex(folderPath, regexPattern) { - return fs.readdirSync(folderPath).filter((file) => regexPattern.test(file)) - .length; -} - -function fontRegex(fontName) { - return new RegExp( - `^${fontName.replace(/\s+/g, "")}-([1-9]00)?(regular|italic)?\\.[ot]tf$`, - "i" - ); -} - -function copyFolderContents(sourceFolder, destinationFolder) { - const files = fs.readdirSync(sourceFolder); - return Promise.all( - files.map((file) => - fs.promises.copyFile( - path.join(sourceFolder, file), - path.join(destinationFolder, file) - ) - ) - ); -} - -const downloadFolder = "download/font"; -const distFontFolder = "dist/fonts"; -const ttfFontFolder = "build/font/ttf"; -const bundleFontFolder = "download/font-bundle"; - -function loadGoogleFonts(fontSpec, destFolder) { - for (const fontFamily in fontSpec) { - if ( - fontSpec[fontFamily].length == - countFilesMatchingRegex(downloadFolder, fontRegex(fontFamily)) + - countFilesMatchingRegex(bundleFontFolder, fontRegex(fontFamily)) - ) { - console.log(`Already downloaded ${fontFamily}`); - continue; - } - - const variants = fontSpec[fontFamily].join(","); - - execSync( - //Requires google-font-installer - `npm exec -- gfi download "${fontFamily}" -v ${variants} -d ${destFolder}`, - (error, stdout, stderr) => { - if (error) { - console.log(`error: ${error.message}`); - return; - } - if (stderr) { - console.log(`stderr: ${stderr}`); - return; - } - console.log(`stdout: ${stdout}`); - } - ); - console.log(`Downloaded ${fontFamily}`); - } -} - -[downloadFolder, ttfFontFolder, distFontFolder, bundleFontFolder].forEach( - (folder) => fs.mkdirSync(folder, { recursive: true }) -); - -const fontDef = JSON.parse(fs.readFileSync("scripts/fonts.json")); -const fontRanges = fontDef["glyph-ranges"]; -const customFontStacks = fontDef["custom-font-stacks"]; -const bundleFontStacks = fontDef["bundle-font-stacks"]; -const fontFamilies = fontDef["font-families"]; - -loadGoogleFonts(fontFamilies, downloadFolder); - -//Just copy fonts that are used unmodified -loadGoogleFonts(bundleFontStacks, bundleFontFolder); - -copyFolderContents(bundleFontFolder, ttfFontFolder); - -for (const stack in customFontStacks) { - let font; - for (const stackPart in customFontStacks[stack]) { - let stackPartDef = customFontStacks[stack][stackPart]; - const inputFontBuffer = fs.readFileSync( - `${downloadFolder}/${stackPartDef.file}.ttf` - ); - - const ranges = stackPartDef.ranges; - for (const range in ranges) { - const namedRange = ranges[range]; - const numberedRanges = fontRanges[namedRange]; - for (const numberedRange in numberedRanges) { - const subsetRange = numberedRanges[numberedRange]; - const subsetGlyphArray = createRangeArray( - subsetRange[0], - subsetRange[1] - ); - const fontSegment = Font.create(inputFontBuffer, { - type: "ttf", - subset: subsetGlyphArray, - hinting: true, - compound2simple: true, - inflate: null, - combinePath: false, - }); - if (font === undefined) { - font = fontSegment; - font.data.name = { - copyright: "Repackaged from Google Fonts", - fontFamily: "Americana", - fullName: stack, - manufacturer: "OpenStreetMap Americana Team", - }; - } else { - font.merge(fontSegment); - } - } - } - } - - // write font file - const outputBuffer = font.write({ - // support ttf, woff, woff2, eot, svg - type: "ttf", - // save font hinting - hinting: true, - // deflate function for woff, eg. pako.deflate - deflate: null, - // for user to overwrite head.xMin, head.xMax, head.yMin, head.yMax, hhea etc. - support: { head: {}, hhea: {} }, - }); - - const ttfFile = `build/font/ttf/${stack}.ttf`; - fs.writeFileSync(ttfFile, outputBuffer); - console.log(`Built ${ttfFile}`); -} - -const pbfBuilderFilename = "~/.cargo/bin/build_pbf_glyphs"; - -async function buildPbf() { - try { - const { stdout, stderr } = await promisify(exec)( - `${pbfBuilderFilename} ${ttfFontFolder} ${distFontFolder}` - ); - console.log(`${stdout}`); - if (stderr) { - console.log(`PBF stderr: ${stderr}`); - } - } catch (error) { - console.log(`PBF build error: ${error.message}`); - process.exit(-1); - } -} - -buildPbf(); - -console.log("Generated PBF fontstack."); diff --git a/scripts/fonts.json b/scripts/fonts.json deleted file mode 100644 index a0e89ef2f..000000000 --- a/scripts/fonts.json +++ /dev/null @@ -1,610 +0,0 @@ -{ - "font-families": { - "Gothic A1": ["regular", "700"], - "M PLUS Rounded 1c": ["regular", "700"], - "Noto Sans": ["regular", "700", "italic", "700italic"], - "Noto Sans Arabic": ["regular", "700"], - "Noto Naskh Arabic": ["regular", "700"], - "Noto Sans Armenian": ["regular", "700"], - "Noto Sans Bengali": ["regular", "700"], - "Noto Sans Canadian Aboriginal": ["regular", "700"], - "Noto Sans Cherokee": ["regular", "700"], - "Noto Sans Devanagari": ["regular", "700"], - "Noto Sans Ethiopic": ["regular", "600"], - "Noto Sans Georgian": ["regular", "700"], - "Noto Sans Gujarati": ["regular", "700"], - "Noto Sans Gurmukhi": ["regular", "700"], - "Noto Sans Hebrew": ["regular", "700"], - "Noto Rashi Hebrew": ["regular", "700"], - "Noto Sans Kannada": ["regular", "700"], - "Noto Sans Khmer": ["regular", "700"], - "Noto Sans Lao": ["regular", "700"], - "Noto Sans Malayalam": ["regular", "700"], - "Noto Sans Myanmar": ["regular", "700"], - "Noto Sans Oriya": ["regular", "700"], - "Noto Sans Sinhala": ["regular", "700"], - "Noto Sans Symbols": ["regular", "700"], - "Noto Sans Tamil": ["regular", "700"], - "Noto Sans Thaana": ["regular", "700"], - "Noto Serif Tibetan": ["regular", "700"], - "Noto Sans Tifinagh": ["regular"], - "Noto Sans Telugu": ["regular", "700"], - "Noto Sans Thai": ["regular", "700"] - }, - "bundle-font-stacks": { - "Noto Sans HK": ["regular", "700"], - "Noto Sans JP": ["regular", "700"], - "Noto Sans KR": ["regular", "700"], - "Noto Sans SC": ["regular", "700"], - "Noto Sans TC": ["regular", "700"] - }, - "glyph-ranges": { - "arabic": [ - [1536, 1791], - [1872, 1919], - [2160, 2303], - [64336, 65023], - [65136, 65279], - [69216, 69247], - [69312, 69375], - [126064, 126143], - [126208, 126287], - [126464, 126719] - ], - "armenian": [ - [1328, 1423], - [64272, 64279] - ], - "bengali": [[2432, 2559]], - "bopomofo": [ - [12544, 12591], - [12704, 12735] - ], - "burmese": [[4096, 4255]], - "canadian_aboriginal": [ - [5120, 5487], - [6928, 6975], - [71216, 71231] - ], - "cherokee": [ - [5024, 5119], - [43888, 43967] - ], - "cyrillic": [ - [1024, 1327], - [7296, 7311], - [11744, 11775], - [42560, 42655], - [65070, 65071], - [122928, 123023] - ], - "devanagari": [[2304, 2431]], - "ethiopic": [ - [4608, 5017], - [11648, 11743], - [43776, 43823] - ], - "fullwidth": [[65280, 65519]], - "greek": [ - [880, 1023], - [7936, 8191], - [65856, 65999], - [119296, 119375] - ], - "georgian": [ - [4256, 4351], - [7312, 7359], - [11520, 11567] - ], - "gurmukhi": [[2560, 2687]], - "gujarati": [[2688, 2751]], - "han": [ - [11904, 12031], - [12032, 12245], - [12272, 12283], - [12284, 12287], - [12288, 12351] - ], - "hangul": [ - [4352, 4607], - [12592, 12687], - [43360, 43391], - [55216, 55295] - ], - "hebrew": [ - [1424, 1535], - [64280, 64335] - ], - "hiragana": [[12352, 12447]], - "kanbun": [[12688, 12703]], - "kannada": [[3200, 3327]], - "kanji": [[19968, 40959]], - "katakana": [ - [12448, 12543], - [12784, 12799] - ], - "khmer": [[6016, 6911]], - "latin": [ - [33, 879], - [7424, 7615], - [7680, 7935], - [8192, 8591], - [11360, 11391], - [42784, 43007], - [43824, 43887], - [64256, 64271], - [67456, 67519], - [122624, 122879] - ], - "lao": [[3712, 3839]], - "malayalam": [[3328, 3455]], - "oriya": [[2816, 2943]], - "sinhala": [[3456, 3583]], - "space": [[32, 32]], - "symbols": [[8592, 8703]], - "tamil": [[2944, 3071]], - "telugu": [[3072, 3199]], - "thaana": [[1920, 1983]], - "tibetan": [[3840, 4095]], - "tifinagh": [[11568, 11631]], - "thai": [[3584, 3711]] - }, - "custom-font-stacks": { - "Americana-Regular": [ - { - "file": "GothicA1-regular", - "ranges": ["space", "hangul"] - }, - { - "file": "MPlusRounded1C-regular", - "ranges": ["fullwidth", "hiragana", "kanbun", "katakana"] - }, - { - "file": "NotoSansArabic-regular", - "ranges": ["arabic"] - }, - { - "file": "NotoSansArmenian-regular", - "ranges": ["armenian"] - }, - { - "file": "NotoSansBengali-regular", - "ranges": ["bengali"] - }, - { - "file": "NotoSansCanadianAboriginal-regular", - "ranges": ["canadian_aboriginal"] - }, - { - "file": "NotoSansCherokee-regular", - "ranges": ["cherokee"] - }, - { - "file": "NotoSansDevanagari-regular", - "ranges": ["devanagari"] - }, - { - "file": "NotoSansEthiopic-regular", - "ranges": ["ethiopic"] - }, - { - "file": "NotoSansGeorgian-regular", - "ranges": ["georgian"] - }, - { - "file": "NotoSansGujarati-regular", - "ranges": ["gujarati"] - }, - { - "file": "NotoSansGurmukhi-regular", - "ranges": ["gurmukhi"] - }, - { - "file": "NotoSansHebrew-regular", - "ranges": ["hebrew"] - }, - { - "file": "NotoSansKannada-regular", - "ranges": ["kannada"] - }, - { - "file": "NotoSansKhmer-regular", - "ranges": ["khmer"] - }, - { - "file": "NotoSansLao-regular", - "ranges": ["lao"] - }, - { - "file": "NotoSansMalayalam-regular", - "ranges": ["malayalam"] - }, - { - "file": "NotoSansMyanmar-regular", - "ranges": ["burmese"] - }, - { - "file": "NotoSansOriya-regular", - "ranges": ["oriya"] - }, - { - "file": "NotoSansSinhala-regular", - "ranges": ["sinhala"] - }, - { - "file": "NotoSansSymbols-regular", - "ranges": ["symbols"] - }, - { - "file": "NotoSansTamil-regular", - "ranges": ["tamil"] - }, - { - "file": "NotoSansTelugu-regular", - "ranges": ["telugu"] - }, - { - "file": "NotoSansThaana-regular", - "ranges": ["thaana"] - }, - { - "file": "NotoSansThai-regular", - "ranges": ["thai"] - }, - { - "file": "NotoSerifTibetan-regular", - "ranges": ["tibetan"] - }, - { - "file": "NotoSansTifinagh-regular", - "ranges": ["tifinagh"] - }, - { - "file": "NotoSans-regular", - "ranges": ["cyrillic", "greek", "latin"] - } - ], - "Americana-Bold": [ - { - "file": "GothicA1-700", - "ranges": ["space", "hangul"] - }, - { - "file": "MPlusRounded1C-700", - "ranges": ["fullwidth", "hiragana", "kanbun", "katakana"] - }, - { - "file": "NotoSansArabic-700", - "ranges": ["arabic"] - }, - { - "file": "NotoSansArmenian-700", - "ranges": ["armenian"] - }, - { - "file": "NotoSansBengali-700", - "ranges": ["bengali"] - }, - { - "file": "NotoSansCanadianAboriginal-700", - "ranges": ["canadian_aboriginal"] - }, - { - "file": "NotoSansCherokee-700", - "ranges": ["cherokee"] - }, - { - "file": "NotoSansDevanagari-700", - "ranges": ["devanagari"] - }, - { - "file": "NotoSansEthiopic-600", - "ranges": ["ethiopic"] - }, - { - "file": "NotoSansGeorgian-700", - "ranges": ["georgian"] - }, - { - "file": "NotoSansGujarati-700", - "ranges": ["gujarati"] - }, - { - "file": "NotoSansGurmukhi-700", - "ranges": ["gurmukhi"] - }, - { - "file": "NotoSansKannada-700", - "ranges": ["kannada"] - }, - { - "file": "NotoSansHebrew-700", - "ranges": ["hebrew"] - }, - { - "file": "NotoSansKhmer-700", - "ranges": ["khmer"] - }, - { - "file": "NotoSansLao-700", - "ranges": ["lao"] - }, - { - "file": "NotoSansMalayalam-700", - "ranges": ["malayalam"] - }, - { - "file": "NotoSansMyanmar-700", - "ranges": ["burmese"] - }, - { - "file": "NotoSansOriya-700", - "ranges": ["oriya"] - }, - { - "file": "NotoSansSinhala-700", - "ranges": ["sinhala"] - }, - { - "file": "NotoSansSymbols-700", - "ranges": ["symbols"] - }, - { - "file": "NotoSansTamil-700", - "ranges": ["tamil"] - }, - { - "file": "NotoSansTelugu-700", - "ranges": ["telugu"] - }, - { - "file": "NotoSansThaana-700", - "ranges": ["thaana"] - }, - { - "file": "NotoSansThai-700", - "ranges": ["thai"] - }, - { - "file": "NotoSerifTibetan-700", - "ranges": ["tibetan"] - }, - { - "file": "NotoSansTifinagh-regular", - "ranges": ["tifinagh"] - }, - { - "file": "NotoSans-700", - "ranges": ["cyrillic", "greek", "latin"] - } - ], - "Americana-Italic": [ - { - "file": "GothicA1-regular", - "ranges": ["space", "hangul"] - }, - { - "file": "MPlusRounded1C-regular", - "ranges": ["fullwidth", "hiragana", "kanbun", "katakana"] - }, - { - "file": "NotoSansArabic-regular", - "ranges": ["arabic"] - }, - { - "file": "NotoSansArmenian-regular", - "ranges": ["armenian"] - }, - { - "file": "NotoSansBengali-regular", - "ranges": ["bengali"] - }, - { - "file": "NotoSansCanadianAboriginal-regular", - "ranges": ["canadian_aboriginal"] - }, - { - "file": "NotoSansCherokee-regular", - "ranges": ["cherokee"] - }, - { - "file": "NotoSansDevanagari-regular", - "ranges": ["devanagari"] - }, - { - "file": "NotoSansEthiopic-regular", - "ranges": ["ethiopic"] - }, - { - "file": "NotoSansGeorgian-regular", - "ranges": ["georgian"] - }, - { - "file": "NotoSansGujarati-regular", - "ranges": ["gujarati"] - }, - { - "file": "NotoSansGurmukhi-regular", - "ranges": ["gurmukhi"] - }, - { - "file": "NotoSansKannada-regular", - "ranges": ["kannada"] - }, - { - "file": "NotoSansKhmer-regular", - "ranges": ["khmer"] - }, - { - "file": "NotoSansLao-regular", - "ranges": ["lao"] - }, - { - "file": "NotoRashiHebrew-regular", - "ranges": ["hebrew"] - }, - { - "file": "NotoSansMalayalam-regular", - "ranges": ["malayalam"] - }, - { - "file": "NotoSansMyanmar-regular", - "ranges": ["burmese"] - }, - { - "file": "NotoSansOriya-regular", - "ranges": ["oriya"] - }, - { - "file": "NotoSansSinhala-regular", - "ranges": ["sinhala"] - }, - { - "file": "NotoSansSymbols-regular", - "ranges": ["symbols"] - }, - { - "file": "NotoSansTamil-regular", - "ranges": ["tamil"] - }, - { - "file": "NotoSansTelugu-regular", - "ranges": ["telugu"] - }, - { - "file": "NotoSansThaana-regular", - "ranges": ["thaana"] - }, - { - "file": "NotoSansThai-regular", - "ranges": ["thai"] - }, - { - "file": "NotoSerifTibetan-regular", - "ranges": ["tibetan"] - }, - { - "file": "NotoSansTifinagh-regular", - "ranges": ["tifinagh"] - }, - { - "file": "NotoSans-italic", - "ranges": ["cyrillic", "greek", "latin"] - } - ], - "Americana-Bold-Italic": [ - { - "file": "GothicA1-700", - "ranges": ["space", "hangul"] - }, - { - "file": "MPlusRounded1C-700", - "ranges": ["fullwidth", "hiragana", "kanbun", "katakana"] - }, - { - "file": "NotoSansArabic-700", - "ranges": ["arabic"] - }, - { - "file": "NotoSansArmenian-700", - "ranges": ["armenian"] - }, - { - "file": "NotoSansBengali-700", - "ranges": ["bengali"] - }, - { - "file": "NotoSansCanadianAboriginal-700", - "ranges": ["canadian_aboriginal"] - }, - { - "file": "NotoSansCherokee-700", - "ranges": ["cherokee"] - }, - { - "file": "NotoSansDevanagari-700", - "ranges": ["devanagari"] - }, - { - "file": "NotoSansEthiopic-600", - "ranges": ["ethiopic"] - }, - { - "file": "NotoSansGeorgian-700", - "ranges": ["georgian"] - }, - { - "file": "NotoSansGujarati-700", - "ranges": ["gujarati"] - }, - { - "file": "NotoSansGurmukhi-700", - "ranges": ["gurmukhi"] - }, - { - "file": "NotoSansKannada-700", - "ranges": ["kannada"] - }, - { - "file": "NotoSansKhmer-700", - "ranges": ["khmer"] - }, - { - "file": "NotoSansLao-700", - "ranges": ["lao"] - }, - { - "file": "NotoRashiHebrew-700", - "ranges": ["hebrew"] - }, - { - "file": "NotoSansMalayalam-700", - "ranges": ["malayalam"] - }, - { - "file": "NotoSansMyanmar-700", - "ranges": ["burmese"] - }, - { - "file": "NotoSansOriya-700", - "ranges": ["oriya"] - }, - { - "file": "NotoSansSinhala-700", - "ranges": ["sinhala"] - }, - { - "file": "NotoSansSymbols-700", - "ranges": ["symbols"] - }, - { - "file": "NotoSansTamil-700", - "ranges": ["tamil"] - }, - { - "file": "NotoSansTelugu-700", - "ranges": ["telugu"] - }, - { - "file": "NotoSansThaana-700", - "ranges": ["thaana"] - }, - { - "file": "NotoSansThai-700", - "ranges": ["thai"] - }, - { - "file": "NotoSerifTibetan-700", - "ranges": ["tibetan"] - }, - { - "file": "NotoSansTifinagh-regular", - "ranges": ["tifinagh"] - }, - { - "file": "NotoSans-700italic", - "ranges": ["cyrillic", "greek", "latin"] - } - ] - } -} diff --git a/scripts/generate_style.js b/scripts/generate_style.js index 4c37dac79..3f097415c 100644 --- a/scripts/generate_style.js +++ b/scripts/generate_style.js @@ -22,7 +22,7 @@ let opts = program.opts(); let style = Style.build( config.OPENMAPTILES_URL, "https://zelonewolf.github.io/openstreetmap-americana/sprites/sprite", - "https://zelonewolf.github.io/openstreetmap-americana/fonts/{fontstack}/{range}.pbf", + "https://osm-americana.github.io/fontstack66/{fontstack}/{range}.pbf", opts.locales ); diff --git a/scripts/stats.js b/scripts/stats.js index f337496a3..26662d65e 100644 --- a/scripts/stats.js +++ b/scripts/stats.js @@ -24,7 +24,7 @@ if (Object.keys(opts).length === 1) program.help(); let style = Style.build( config.OPENMAPTILES_URL, "https://zelonewolf.github.io/openstreetmap-americana/sprites/sprite", - "https://zelonewolf.github.io/openstreetmap-americana/fonts/{fontstack}/{range}.pbf", + "https://osm-americana.github.io/fontstack66/{fontstack}/{range}.pbf", opts.locales ); diff --git a/src/americana.js b/src/americana.js index cd52c7cc0..93eb1a251 100644 --- a/src/americana.js +++ b/src/americana.js @@ -30,7 +30,7 @@ export function buildStyle() { return Style.build( config.OPENMAPTILES_URL, `${baseUrl}/sprites/sprite`, - `${baseUrl}/fonts/{fontstack}/{range}.pbf`, + "https://osm-americana.github.io/fontstack66/{fontstack}/{range}.pbf", Label.getLocales() ); } From 7c067e8b427832ecb8b306151b82ff94d2807a2c Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sun, 18 Jun 2023 08:31:48 -0400 Subject: [PATCH 40/43] Remove Rust config --- .cargo/config.toml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index 70f9eaeb2..000000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,2 +0,0 @@ -[registries.crates-io] -protocol = "sparse" From debef74b08f8ee2d60d23ddec8bae4da33e37ed3 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sun, 18 Jun 2023 11:37:09 -0400 Subject: [PATCH 41/43] Prettier --- CONTRIBUTING.md | 2 +- src/americana.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8f9e85dd9..83436d94a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -383,4 +383,4 @@ For consistency, POI icons use the following color palette: ## Fonts -Fonts for style labels are packaged and defined in [fontstack66](https://github.com/osm-americana/fontstack66), Americana's font package. \ No newline at end of file +Fonts for style labels are packaged and defined in [fontstack66](https://github.com/osm-americana/fontstack66), Americana's font package. diff --git a/src/americana.js b/src/americana.js index 93eb1a251..af2227949 100644 --- a/src/americana.js +++ b/src/americana.js @@ -30,7 +30,7 @@ export function buildStyle() { return Style.build( config.OPENMAPTILES_URL, `${baseUrl}/sprites/sprite`, - "https://osm-americana.github.io/fontstack66/{fontstack}/{range}.pbf", + "https://osm-americana.github.io/fontstack66/{fontstack}/{range}.pbf", Label.getLocales() ); } From 0568c400d0a46d6e42101085982b961efbe2406c Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sun, 18 Jun 2023 13:02:52 -0400 Subject: [PATCH 42/43] Add font override --- src/americana.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/americana.js b/src/americana.js index bd9b709c4..3d22e098d 100644 --- a/src/americana.js +++ b/src/americana.js @@ -32,7 +32,8 @@ export function buildStyle() { return Style.build( config.OPENMAPTILES_URL, `${baseUrl}/sprites/sprite`, - "https://osm-americana.github.io/fontstack66/{fontstack}/{range}.pbf", + config.FONT_URL ?? + "https://osm-americana.github.io/fontstack66/{fontstack}/{range}.pbf", Label.getLocales() ); } From e1c519e88731653691ef513f17ad158e5b048af1 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Sun, 18 Jun 2023 13:06:43 -0400 Subject: [PATCH 43/43] Add hook for FONT_URL --- src/configs/config.aws.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/configs/config.aws.js b/src/configs/config.aws.js index da8ec255b..9727e7f64 100644 --- a/src/configs/config.aws.js +++ b/src/configs/config.aws.js @@ -13,8 +13,15 @@ Both accept an HTML color name, hex code, or other CSS color value. const SHIELD_TEXT_BBOX_COLOR = null; const SHIELD_TEXT_HALO_COLOR_OVERRIDE = null; +/* +Uncomment the following line here and in the export block to change the location +of the font stack (normally, for development and test) +*/ +//const FONT_URL = font_stack_url + export default { OPENMAPTILES_URL, SHIELD_TEXT_BBOX_COLOR, SHIELD_TEXT_HALO_COLOR_OVERRIDE, + // FONT_URL, };