Skip to content

Commit

Permalink
layer param and geom in geojson query
Browse files Browse the repository at this point in the history
  • Loading branch information
dbauszus-glx committed Nov 14, 2023
1 parent 1f34a33 commit 91b7e63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mod/workspace/templates/geojson.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ module.exports = _ => {
properties = ', json_build_object(' + propertyKeyValuePairs.join(', ') + ') as properties';
}

const where = _.viewport || `AND ${_.geom || layer.geom} IS NOT NULL`
const where = _.viewport || `AND ${_.geom || _.layer.geom} IS NOT NULL`

return `
SELECT
'Feature' AS type,
\${qID} AS id,
ST_asGeoJson(\${geom})::json AS geometry
ST_asGeoJson(${_.geom || _.layer.geom})::json AS geometry
${properties}
FROM \${table}
WHERE TRUE ${where} IS NOT NULL \${filter};`
Expand Down

0 comments on commit 91b7e63

Please sign in to comment.