Skip to content

Commit

Permalink
Merge pull request #1010 from geoadmin/pb-790-fix-print-editableFeatu…
Browse files Browse the repository at this point in the history
…re-error-empty-annotation

PB-790: Fix failed to print on empty string text drawing. - #minor
  • Loading branch information
ismailsunni authored Aug 6, 2024
2 parents db133dc + 71427b0 commit 21f75cb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/api/print.api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 21f75cb

Please sign in to comment.