Map and Legend components rewritten using hooks.
Also, each category can now have multiple available colour scales.
These can be switched using a select dropdown in the legend.
* Add subtle border for age layer buildings
* Simplify map data queries
* Fix typo in updated construction layer query
* Enable data tile caching switch for development
* Enable turning tile cache off
* Use render time variables for highlight tiles
* Create building numbers map layer
* Create database view for simpler map queries
* Decrease min zoom for numbers layer
* Add building outlines to all map layers
* Adjust building numbers style and zoom level
* Revert "Create database view for simpler map queries"
This reverts commit e3c342cb7393f491c838df5654c2316a9dab08e1
which cannot be implemented before upgrading Postgres to min v11
The new method uses the composite() method of sharp
to reduce the number of times a PNG buffer is created.
The number could be further reduced from two to one,
if the issue #1908 from lovell/sharp is resolved so that
composite and resize can be chained without an
intermediate call to .png().toBuffer()
The tile params formatting is used for caching.
Don't add the @1x suffix for scale 1, in order to
re-use old cache from before retina tiles were enabled
Most errors highglighted by TS were due to a lack of type definitions
and were ignored by settings types to `any`.
Some minor bugs were resolved where the fix was obvious.
TODO marks left where `any` needs to be later removed or bugfix verified
- tileserver changes use of cache (slightly simplified from callbacks)
- cache methods return promises
- add 'remove' method to cache, with remove_all_at_bbox helper
- from api/building.js, call remove after successful db updates