From ec8657ebe8dd35130d8afb99ac4e4da76a5d4ee4 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Fri, 15 Mar 2024 14:58:50 +0100 Subject: [PATCH] Onldy create declutter builder group when using it --- src/MVTEncoder.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/MVTEncoder.ts b/src/MVTEncoder.ts index 3c1245e..a28e17a 100644 --- a/src/MVTEncoder.ts +++ b/src/MVTEncoder.ts @@ -133,7 +133,7 @@ export default class MVTEncoder { ); let declutterBuilderGroup: CanvasBuilderGroup | undefined; - if (declutter) { + if (declutter && olMajorVersion <= 9) { declutterBuilderGroup = new CanvasBuilderGroup( 0, featuresExtent.extent, @@ -173,7 +173,9 @@ export default class MVTEncoder { tolerance, resourceLoadedListener, undefined, - declutterBuilderGroup + olMajorVersion <= 9 + ? (declutterBuilderGroup as unknown as boolean) + : declutter ) || loading; } }