kosmtik / kosmtik

Make maps with OpenStreetMap and Mapnik
Other
714 stars 83 forks source link

Colourize layers on inspection view #27

Closed gravitystorm closed 9 years ago

gravitystorm commented 9 years ago

In the inspection view, all the data is the same (orange) colour. It would be helpful to colour each layer seperately, so that it's easier to tell which layer different features are coming from.

mapbox-studio has a great "xray" behaviour that generates colours automatically for each layer. It also fills in polygons, draws and labels point features.

yohanboniface commented 9 years ago

Very good point about colors!

This will need a rework of the system, because at the moment I'm using raw geojson built by Mapnik, and features have lost the layer name at this stage.

@springmeyer is adding the layer name to the features when in __all__ mode somehow conceivable in node-mapnik? Or maybe I'm just not taking the problem from the correct perspective?

@gravitystorm side note (I know it doesn't cover the issue): have you seen that from the "Inspect" panel you can choose to show only one layer?

springmeyer commented 9 years ago

@springmeyer is adding the layer name to the features when in all mode somehow conceivable in node-mapnik?

Possible yes, but...

Or maybe I'm just not taking the problem from the correct perspective?

To solve this problem overall I would recommend using the xray functionality directly or via https://github.com/mojodna/tilelive-xray. It will be faster than using geojson as an intermediary.

yohanboniface commented 9 years ago

Oh, nice, thanks for the hint, Dane :)

yohanboniface commented 9 years ago

So I've implemented a simple XRayTile following the very nice idea suggested (I've already weighted up in the past the possibility to pull in the tilelive suite, but for now I prefer a lighter way).

For the record, basically, here how it works:

All this is allowed thanks to Mapnik vector tiles, which is really an amazing step forward. So this is one more good reason we should build up a monument to @springmeyer. Dane, thanks! :)

gravitystorm commented 9 years ago

Very nice! works a treat.