diff --git a/app/map_styles/polygon.xml b/app/map_styles/polygon.xml index bb2ed8a0..aa99e8f2 100644 --- a/app/map_styles/polygon.xml +++ b/app/map_styles/polygon.xml @@ -152,4 +152,9 @@ + diff --git a/app/src/frontend/map.js b/app/src/frontend/map.js index 500f598c..a58f6f14 100644 --- a/app/src/frontend/map.js +++ b/app/src/frontend/map.js @@ -77,6 +77,7 @@ class ColouringMap extends Component { age: 'date_year', size: 'size_storeys', location: 'location', + like: 'likes', } const data_tileset = tileset_by_cat[cat]; const dataLayer = data_tileset? diff --git a/app/src/tileserver.js b/app/src/tileserver.js index 34007fd2..ac3300d2 100644 --- a/app/src/tileserver.js +++ b/app/src/tileserver.js @@ -162,4 +162,27 @@ router.get('/location/:z/:x/:y.png', function(req, res) { }) }); + +// location information depth +router.get('/likes/: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.likes_total > 0 + ) as location` + const style_def = ['likes'] + 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;