Skip to content

Commit

Permalink
fields length fix for distributed themes
Browse files Browse the repository at this point in the history
  • Loading branch information
dbauszus-glx committed Mar 4, 2024
1 parent 70f7217 commit 508d0ba
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/layer/featureFields.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ featureFields.process(layer) will process the fields required for a theme and re
export function process(layer) {

// Check if the distribution method is defined in the distribution object.
if (Object.hasOwnProperty(distribution, layer.style?.theme?.distribution)) {
if (Object.hasOwn(distribution, layer.style?.theme?.distribution)) {

// Call the corresponding distribution function.
distribution[layer.style.theme.distribution](layer);
Expand Down
3 changes: 0 additions & 3 deletions lib/layer/format/mvt.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,6 @@ function changeEndLoad(layer) {
layer.style.label?.field
].flat().filter(field => !!field))]

// Do not query WKT without fields.
if (!layer.params.fields.length) return;

const bounds = layer.mapview.getBounds()

// Assign current viewport if queryparam is truthy.
Expand Down
2 changes: 1 addition & 1 deletion mod/workspace/templates/wkt.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ module.exports = _ => {
return `
SELECT
\${qID} AS id
${fields && `, ${fields.join(', ')}` || ''}
${fields.length && `, ${fields.join(', ')}` || ''}
FROM \${table}
WHERE TRUE ${where} \${filter};`
}

0 comments on commit 508d0ba

Please sign in to comment.