diff --git a/app/src/tileserver.js b/app/src/tileserver.js index 291b51f4..dffbb7ad 100644 --- a/app/src/tileserver.js +++ b/app/src/tileserver.js @@ -163,7 +163,7 @@ router.get('/location/:z/:x/:y.png', function(req, res) { }); -// location information depth +// likes router.get('/likes/:z/:x/:y.png', function(req, res) { const bbox = get_bbox(req.params) const table_def = `( @@ -186,4 +186,27 @@ router.get('/likes/:z/:x/:y.png', function(req, res) { }) }); + +// conservation status +router.get('/conservation_area/:z/:x/:y.png', function(req, res) { + const bbox = get_bbox(req.params) + const table_def = `( + SELECT + g.geometry_geom + FROM + geometries as g, + buildings as b + WHERE + g.geometry_id = b.geometry_id + AND b.planning_in_conservation_area = true + ) as conservation_area` + const style_def = ['planning_in_conservation_area'] + render_tile(bbox, table_def, style_def, function(err, im) { + if (err) throw err + + res.writeHead(200, {'Content-Type': 'image/png'}) + res.end(im.encodeSync('png')) + }) +}); + export default router;