From 3241721f2bdf230d6a359cdb5a6db1a67f5a8410 Mon Sep 17 00:00:00 2001 From: Richard Zink Date: Wed, 7 Oct 2026 14:37:08 +0200 Subject: [PATCH] Skip reverse-geocoding if CONFIG.location.label already set --- config.js | 3 ++- index.html | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config.js b/config.js index 2d71f76..7add963 100644 --- a/config.js +++ b/config.js @@ -17,7 +17,8 @@ * by the SunCalc library (SunCalc.getTimes, getMoonTimes, * getPosition). Object with 'lat' (latitude, -90 to +90) * and 'lon' (longitude, -180 to +180). Positive lat = north, - * positive lon = east. + * positive lon = east. Optionally add 'label' (string) to + * set a custom place name (skips reverse-geocoding). * * timeFormat - Format string for the digital clock, using strict * ISO 8601 tokens (case-sensitive). Any other character is diff --git a/index.html b/index.html index 4ec86ee..2fbcd35 100644 --- a/index.html +++ b/index.html @@ -1665,7 +1665,10 @@ window.weatherThemes = { // Reverse geocode lat/lon to a place name using Nominatim (OpenStreetMap). // Free, no API key required. Has a 1 req/sec rate limit. + // Skipped if a custom label is already configured (luxury: user can + // set their own place name in CONFIG.location.label). function reverseGeocode(lat, lon) { + if (window.CONFIG && window.CONFIG.location && window.CONFIG.location.label) return; var url = 'https://nominatim.openstreetmap.org/reverse?format=json&lat=' + lat + '&lon=' + lon + '&zoom=10&addressdetails=1'; fetch(url, {