Skip to content

Commit cb62360

Browse files
committed
Fixed issues with using shape icons on the legend
- Color the shape icon rather than background - Removed triangle as a special case (apparently it was never handled)
1 parent f96c4ab commit cb62360

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/essence/Tools/Legend/LegendTool.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,7 @@ function drawLegends(tools, _legend, layerUUID, display_name, opacity) {
249249
if (
250250
shape == 'circle' ||
251251
shape == 'square' ||
252-
shape == 'rect' ||
253-
shape == 'triangle'
252+
shape == 'rect'
254253
) {
255254
switch (shape) {
256255
case 'circle':
@@ -299,12 +298,14 @@ function drawLegends(tools, _legend, layerUUID, display_name, opacity) {
299298
.style('background-repeat', 'no-repeat')
300299
} else { // try using shape from Material Design Icon (mdi) library
301300
r.append('div')
302-
.attr('class', layerUUID + '_legendicon' + ' mdi mdi-18px mdi-' + shape)
301+
.attr('class', layerUUID + '_legendicon')
303302
.style('width', '18px')
304303
.style('height', '18px')
305-
.style('background', _legend[d].color)
306-
.style('opacity', opacity)
307-
.style('border', `1px solid ${_legend[d].strokecolor}`)
304+
.append('i')
305+
.attr('class', 'mdi mdi-18px mdi-' + shape)
306+
.style('color', _legend[d].color)
307+
.style('opacity', opacity)
308+
.style('border', `1px solid ${_legend[d].strokecolor}`)
308309
}
309310

310311
r.append('div')

0 commit comments

Comments
 (0)