Skip to content

Commit cb63ecc

Browse files
committed
Support additional image file formats for the legend
1 parent cb62360 commit cb63ecc

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

configure/src/metaconfigs/layer-vector-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@
528528
{
529529
"field": "shapeImage",
530530
"name": "Shape From Image",
531-
"description": "A URL to a custom image (.png or .svg) for which to use for this legend entry. If the path is relative, it will be relative to the mission's directory. This field will override values in the Shape and Shape From Icon fields.",
531+
"description": "A URL to a custom image (jpeg|jpg|gif|png|svg|webp) for which to use for this legend entry. If the path is relative, it will be relative to the mission's directory. This field will override values in the Shape and Shape From Icon fields.",
532532
"type": "text",
533533
"width": 4
534534
}

configure/src/metaconfigs/layer-vectortile-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@
501501
{
502502
"field": "shapeImage",
503503
"name": "Shape From Image",
504-
"description": "A URL to a custom image (.png or .svg) for which to use for this legend entry. If the path is relative, it will be relative to the mission's directory. This field will override values in the Shape and Shape From Icon fields.",
504+
"description": "A URL to a custom image (jpeg|jpg|gif|png|svg|webp) for which to use for this legend entry. If the path is relative, it will be relative to the mission's directory. This field will override values in the Shape and Shape From Icon fields.",
505505
"type": "text",
506506
"width": 4
507507
}

src/essence/Tools/Legend/LegendTool.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ function drawLegends(tools, _legend, layerUUID, display_name, opacity) {
283283
break
284284
default:
285285
}
286-
} else if ( String(shape).endsWith('.png') || String(shape).endsWith('.svg')) {
287-
// PNG or SVG markers
286+
} else if (String(shape).toLowerCase().match(/\.(jpeg|jpg|gif|png|svg|webp)$/) != null) {
287+
// Image markers
288288
r.append('div')
289289
.attr('class', layerUUID + '_legendcustom')
290290
.style('width', '24px')

0 commit comments

Comments
 (0)