From 71427b05fb5bae87d4b6b8dbc87503f2345f46b1 Mon Sep 17 00:00:00 2001 From: Ismail Sunni Date: Wed, 24 Jul 2024 17:08:58 +0700 Subject: [PATCH] PB-790: Fix failed to print on empty string text drawing. --- src/api/print.api.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/api/print.api.js b/src/api/print.api.js index f574e8111..89ced8425 100644 --- a/src/api/print.api.js +++ b/src/api/print.api.js @@ -351,6 +351,15 @@ async function transformOlMapToPrintParams(olMap, config) { dpi: dpi, customizer: customizer, }) + // Note (IS): This is a dirty fix to handle empty text annotation. See PB-790 + // It should be removed once the issue is fixed in the mapfishprint library + encodedMap.layers.forEach((layer) => { + layer.geoJson?.features?.forEach((feature) => { + // Delete the editableFeature property because it will cause an error in the mapfishprint + // Should be handled inside GeoAdminCustomizer.feature but it skip the feature with empty text + delete feature.properties?.editableFeature + }) + }) if (printGrid) { encodedMap.layers.unshift({ baseURL: WMS_BASE_URL,