Skip to content

Commit

Permalink
assign default style before theme style
Browse files Browse the repository at this point in the history
  • Loading branch information
dbauszus-glx committed Mar 26, 2024
1 parent 2ef2e98 commit 19ee81d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
8 changes: 2 additions & 6 deletions lib/layer/featureStyle.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,13 @@ export default layer => {
return null
}

// Assign geometryType from geometry.
//feature.geometryType ??= feature.getGeometry().getType();
// Set style.default as feature.style.
feature.style = layer.style.default

if (Object.hasOwn(mapp.layer.themes, layer.style.theme?.type)) {

// Apply theme style to style object.
mapp.layer.themes[layer.style.theme?.type]?.(layer.style.theme, feature)
} else {

// Set style.default as feature.style.
feature.style = layer.style.default
}

// Style cluster point features.
Expand Down
5 changes: 1 addition & 4 deletions lib/layer/themes/distributed.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ export default function(theme, feature) {
const val = feature.properties[field]

// Assign theme.style if val is falsy.
if (!val) {
feature.style = theme.style
return;
}
if (!val) return;

// The feature field property value already has a style assigned.
if (theme.lookup[val]) {
Expand Down

0 comments on commit 19ee81d

Please sign in to comment.