From a019cdd36d10c480ddeb06dac83ae6c932d62532 Mon Sep 17 00:00:00 2001 From: glughi Date: Tue, 22 Oct 2024 10:31:21 +0200 Subject: [PATCH] Add Leaflet maxZoom to configParameters --- CHANGES.md | 1 + lib/Models/Leaflet.ts | 1 + lib/Models/Terria.ts | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index f881d02b37..9a2f24446c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ #### next release (8.7.8) +- Add "leafletMaxZoom" to configParameters so that the maxZoom of the Leaflet viewer can be changed. - [The next improvement] #### 8.7.7 - 2024-10-01 diff --git a/lib/Models/Leaflet.ts b/lib/Models/Leaflet.ts index f2054cf847..6b411bed05 100644 --- a/lib/Models/Leaflet.ts +++ b/lib/Models/Leaflet.ts @@ -103,6 +103,7 @@ export default class Leaflet extends GlobeOrMap { clippingRectangle: Rectangle | undefined ) => GridLayer = computedFn((ip, clippingRectangle) => { const layerOptions = { + maxZoom: this.terria.configParameters.leafletMaxZoom, bounds: clippingRectangle && rectangleToLatLngBounds(clippingRectangle) }; // We have two different kinds of ImageryProviderLeaflet layers diff --git a/lib/Models/Terria.ts b/lib/Models/Terria.ts index 78a510487b..c5ba0caa43 100644 --- a/lib/Models/Terria.ts +++ b/lib/Models/Terria.ts @@ -328,6 +328,9 @@ export interface ConfigParameters { */ feedbackMinLength?: number; + /** If undefined, then Leaflet's default attribution will be used */ + leafletMaxZoom: number; + /** If undefined, then Leaflet's default attribution will be used */ leafletAttributionPrefix?: string; @@ -574,6 +577,7 @@ export default class Terria { feedbackPreamble: "translate#feedback.feedbackPreamble", feedbackPostamble: undefined, feedbackMinLength: 0, + leafletMaxZoom: 18, leafletAttributionPrefix: undefined, extraCreditLinks: [ // Default credit links (shown at the bottom of the Cesium map)