diff --git a/src/lib/datasource/shared/capabilities.service.ts b/src/lib/datasource/shared/capabilities.service.ts index 90afb30253..92645f7b9b 100644 --- a/src/lib/datasource/shared/capabilities.service.ts +++ b/src/lib/datasource/shared/capabilities.service.ts @@ -90,8 +90,8 @@ export class CapabilitiesService { // defined under "alias" in the context alias: layer.Title, view: { - maxResolution: layer.MaxScaleDenominator ? Number(layer.MaxScaleDenominator) : Infinity, - minResolution: layer.MaxScaleDenominator ? Number(layer.MinScaleDenominator) : 8000, + maxResolution: this.getResolutionFromScale(layer.MaxScaleDenominator) || Infinity, + minResolution: this.getResolutionFromScale(layer.MinScaleDenominator) || 0 }, metadata: { url: metadata ? metadata.OnlineResource : undefined @@ -136,4 +136,9 @@ export class CapabilitiesService { }); } + private getResolutionFromScale(scale: number): number { + const dpi = 25.4 / 0.28; + return scale/(39.37 * dpi); + } + }