From 44bb49ec96e5dfd5a7ee57ab803b4c87ac33c300 Mon Sep 17 00:00:00 2001 From: slothful-vassal <89943360+slothful-vassal@users.noreply.github.com> Date: Sat, 4 Oct 2025 14:46:52 +0200 Subject: [PATCH] speed up POI retrieval by custom overpass api url (#596) * speed up POI retrieval by custom overpass api url * consistent overpass api url default * switches default to overpass-api.de --------- Co-authored-by: Christian Beutel <> --- docker-compose.yml | 1 + docs/src/content/docs/run/environment-configuration.md | 1 + docs/src/content/docs/run/installation.mdx | 1 + web/Dockerfile | 1 + web/src/lib/vendor/maplibre-layer-manager/overpass-layer.ts | 3 ++- 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 059c055c..9cbbfcb3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -64,6 +64,7 @@ services: UPLOAD_FOLDER: /app/uploads UPLOAD_USER: UPLOAD_PASSWORD: + PUBLIC_OVERPASS_API_URL: https://overpass-api.de PUBLIC_VALHALLA_URL: https://valhalla1.openstreetmap.de PUBLIC_NOMINATIM_URL: https://nominatim.openstreetmap.org volumes: diff --git a/docs/src/content/docs/run/environment-configuration.md b/docs/src/content/docs/run/environment-configuration.md index c53e6200..c3775371 100644 --- a/docs/src/content/docs/run/environment-configuration.md +++ b/docs/src/content/docs/run/environment-configuration.md @@ -48,3 +48,4 @@ Since we use an unmodified installation of meilisearch you can use all variables | UPLOAD_FOLDER | Folder from which wanderer auto-uploads trails | /app/uploads | | UPLOAD_USER | Username for the account with which wanderer auto-uploads trails | | | UPLOAD_PASSWORD | Password for the account with which wanderer auto-uploads trails | | +| PUBLIC_OVERPASS_API_URL | Overpass API URL used for map points of interest | https://overpass-api.de | diff --git a/docs/src/content/docs/run/installation.mdx b/docs/src/content/docs/run/installation.mdx index bd020a66..c5e913b0 100644 --- a/docs/src/content/docs/run/installation.mdx +++ b/docs/src/content/docs/run/installation.mdx @@ -122,6 +122,7 @@ services: UPLOAD_FOLDER: /app/uploads UPLOAD_USER: UPLOAD_PASSWORD: + PUBLIC_OVERPASS_API_URL: https://overpass-api.de PUBLIC_VALHALLA_URL: https://valhalla1.openstreetmap.de PUBLIC_NOMINATIM_URL: https://nominatim.openstreetmap.org volumes: diff --git a/web/Dockerfile b/web/Dockerfile index bf6d2eef..150cc116 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -16,5 +16,6 @@ ENV MEILI_URL=http://127.0.0.1:7700 ENV PUBLIC_DISABLE_SIGNUP=false ENV UPLOAD_USER= ENV UPLOAD_PASSWORD= +ENV PUBLIC_OVERPASS_API_URL= CMD crond && node build \ No newline at end of file diff --git a/web/src/lib/vendor/maplibre-layer-manager/overpass-layer.ts b/web/src/lib/vendor/maplibre-layer-manager/overpass-layer.ts index 0141d3e3..040490a5 100644 --- a/web/src/lib/vendor/maplibre-layer-manager/overpass-layer.ts +++ b/web/src/lib/vendor/maplibre-layer-manager/overpass-layer.ts @@ -9,9 +9,10 @@ import * as M from "maplibre-gl"; import { type LngLatBounds, type MapMouseEvent, type StyleSpecification } from "maplibre-gl"; import { pois, type BaseLayer, type MapState } from "./layers"; import type { OverpassResponse } from "./types"; +import { env } from '$env/dynamic/public' export class OverpassLayer implements BaseLayer { - private overpassApiURL: string = "https://overpass.private.coffee/api/interpreter" + private overpassApiURL: string = (env.PUBLIC_OVERPASS_API_URL && env.PUBLIC_OVERPASS_API_URL.length > 0 ? env.PUBLIC_OVERPASS_API_URL : "https://overpass-api.de") + "/api/interpreter"; data: GeoJSON.FeatureCollection = ({ type: 'FeatureCollection', features: [] });