adaptative attribution

This commit is contained in:
vcoppe committed 2026-12-04 09:47:48 +01:00
1 parent 4b5b6b8a20
commit 22a269a6dc
5 files changed
+264 -92

No files matched your search

-18
View File
@@ -16,12 +16,6 @@ import {
} from '$lib/data/layers';
import { getLayers, getOpacityPaint, prefixStyle } from '$lib/components/map/layer-control/utils';
import { i18n } from '$lib/i18n/i18n.svelte';
import {
OPEN_SATELLITE_FALLBACK_PROTOCOL,
OPEN_SATELLITE_PROTOCOL,
openSatelliteAttribution,
openSatelliteFallbackAttribution,
} from '$lib/components/map/open-satellite';
const { currentBasemap, currentOverlays, customLayers, opacities, terrainSource, distanceUnits } =
settings;
@@ -129,18 +123,6 @@ export class StyleManager {
) {
src.url = src.url.replace(maptilerKeyPlaceHolder, this._maptilerKey);
}
if (src && typeof src === 'object' && 'tiles' in src) {
// the credits of the open satellite imagery, kept with its code
if (src.tiles?.some((url) => url.startsWith(`${OPEN_SATELLITE_PROTOCOL}://`))) {
src.attribution = openSatelliteAttribution;
} else if (
src.tiles?.some((url) =>
url.startsWith(`${OPEN_SATELLITE_FALLBACK_PROTOCOL}://`)
)
) {
src.attribution = openSatelliteFallbackAttribution;
}
}
}
} catch (e) {
console.error(e instanceof Error ? e.message : e);