parent
6cc6630196
commit
0ee48597d8
@ -152,4 +152,9 @@
|
||||
<PolygonSymbolizer fill="#7a5732" />
|
||||
</Rule>
|
||||
</Style>
|
||||
<Style name="likes">
|
||||
<Rule>
|
||||
<PolygonSymbolizer fill="#f03b20" />
|
||||
</Rule>
|
||||
</Style>
|
||||
</Map>
|
||||
|
@ -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?
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user