From f57174bcd10a064327a254ab9a4218c119796adc Mon Sep 17 00:00:00 2001 From: Rudo Kemper Date: Tue, 5 May 2026 08:35:23 -0400 Subject: [PATCH 1/2] Allow setting of max tile limit --- .env.example | 2 ++ README.md | 2 ++ components/GenerateMap/MapSidebar.vue | 16 +++++----------- i18n/locales/en.json | 3 +-- i18n/locales/es.json | 3 +-- i18n/locales/nl.json | 3 +-- i18n/locales/pt.json | 3 +-- nuxt.config.ts | 1 + 8 files changed, 14 insertions(+), 19 deletions(-) diff --git a/.env.example b/.env.example index e111af3..d223c12 100644 --- a/.env.example +++ b/.env.example @@ -58,6 +58,8 @@ NUXT_PUBLIC_PLANET_API_KEY=your_planet_api_key NUXT_PUBLIC_STADIA_API_KEY=your_stadia_api_key NUXT_PUBLIC_THUNDERFOREST_API_KEY=your_thunderforest_api_key +NUXT_PUBLIC_MAX_TILES=100000 + # ========================================== # Azure Storage Message Queue configuration # ========================================== diff --git a/README.md b/README.md index cefd935..7641680 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,8 @@ For production environments like Azure, input the environmental variables via th **Mapbox, Planet, Stadia, and Thunderforest API keys and access tokens:** Provide API keys and access tokens to be used across the application for authenticating with map assets. If not provided, the respective map styles will not show in the generate map view. +**Maximum number of tiles:** Provide the maximum number of tiles that can be requested. Default is 100,000. It is recommended to use a sane default that will ensure that your users will not exceed any API free tier limits. (For example, Mapbox currently has a limit of 200,000 tile requests for the [Mapbox Static API](https://www.mapbox.com/pricing#static-tiles-api).) + **Message Queue:** Provide your message queue variables to publish your map request to a storage queue service, where it can be picked up by a [mapgl-tile-renderer](http://github.com/conservationMetrics/mapgl-tile-renderer/) task worker. For Azure, you need a queue name, a storage account name, and a storage account key. **Offline map storage:** Provide a URI where the offline maps can be downloaded, as well as a path pointing to a volume mount directory for mapgl-tile-renderer to store the files. diff --git a/components/GenerateMap/MapSidebar.vue b/components/GenerateMap/MapSidebar.vue index ae61178..8495023 100644 --- a/components/GenerateMap/MapSidebar.vue +++ b/components/GenerateMap/MapSidebar.vue @@ -22,6 +22,8 @@ const props = defineProps<{ mapLoadError: boolean; }>(); +const maxTiles = useRuntimeConfig().public.maxTiles as number; + const { t } = useI18n(); onMounted(() => { @@ -135,7 +137,7 @@ const canSubmitMapboxCustom = computed(() => { /** Computes whether the submit button should be disabled. */ const isSubmitDisabled = computed(() => { - return estimatedTiles.value > 275000 || !canSubmitMapboxCustom.value; + return estimatedTiles.value > maxTiles || !canSubmitMapboxCustom.value; }); const emit = defineEmits([ @@ -451,20 +453,12 @@ watch( {{ t("estimatedNumberOfTiles") }}: {{ estimatedTiles.toLocaleString() }}

-

+

{{ t("Warning") }}: - {{ t("over100000Tiles") }} + {{ t("overMaxTilesWarning") }}

-
- {{ t("Warning") }}: - {{ t("over275000Tiles") }} -
-