Skip to content

Commit

Permalink
remove structured clone from theme
Browse files Browse the repository at this point in the history
  • Loading branch information
dbauszus-glx committed Mar 4, 2024
1 parent d92763b commit d8a5e70
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
13 changes: 7 additions & 6 deletions lib/layer/themes/categorized.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ export default function (theme, feature) {

if (feature.geometryType === 'Point') {

// Merge catStyle if icon style is not implicit.
feature.style.icon = cat.style.icon || cat.style
delete feature.style.icon.url;
return;
}
feature.style = {
icon: cat.style.icon
}

} else {

feature.style = structuredClone(cat.style)
feature.style = cat.style
}
}
12 changes: 6 additions & 6 deletions lib/layer/themes/graduated.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ export default function(theme, feature) {

if (feature.geometryType === 'Point') {

// Merge catStyle if icon style is not implicit.
feature.style.icon = cat.style.icon || cat.style
delete feature.style.icon.url;
return;
}
feature.style = {
icon: cat.style.icon
}
} else {

feature.style = structuredClone(cat.style)
feature.style = cat.style
}
}
}
1 change: 0 additions & 1 deletion lib/ui/elements/legendIcon.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export default (style) => {

// Create poly symbol.
if (style.fillColor) return fill(style)

}

function icon(style) {
Expand Down

0 comments on commit d8a5e70

Please sign in to comment.