plepe / openstreetbrowser-categories-main

Styles of the "Main" category of OpenStreetBrowser
5 stars 11 forks source link

Add paddling hazards seamark:restricted_area:restriction and seamark:bridge:clearance_height #64

Closed treestryder closed 1 year ago

treestryder commented 1 year ago

Added basic support for the paddling hazards seamark:restricted_area:restriction (no_entry, restricted_entry) and seamark:bridge:clearance_height. Not the prettiest but wanted to get these hazards supported sooner rather than later.

plepe commented 1 year ago

I'm a bit surprised, that Math.trunc(....) does work at all, although it seems to just return the value it got. Maybe you rather use the filter round instead?

Like so:

{% set value = attribute(tags, 'seamark:bridge:clearance_height')|round %}
treestryder commented 1 year ago

That is fine, I can change it. I guess it does not matter much how I come to an integer, as changing a thermometer icon (closest icons I found to representing spectrum of heights) is ultimately a subtle difference. I chose to truncate any real number values because I wanted the icons to say "less than 1 is as good as 0". Also, I wasn't sure the 0 icon would be used much if the height were rounded up.

plepe commented 1 year ago

The point is, that Math.trunc does not work. Click on any building (from z15): https://openstreetbrowser.org/#categories=custom/02e01534cc22e583e80b53c037b4b267

treestryder commented 1 year ago

Updated. Thanks for catching the problem early. I might not have seen that odd behavior crop up for a while. I only know of the two bridge heights, both set to "1".

treestryder commented 1 year ago

Thank you.

plepe commented 1 year ago

I thank you for your contribution.

By the way - the new category/ies have not been announced on the blog yet. Do you want to come up with a text and a nice screenshot or shall I invent something?

treestryder commented 1 year ago

Though I am rather shy about announcing this, I will see what I can do. But first... I would like to clean up the duplicates in the details view ( see issuecomment-1382881562 ) . Probably by embracing and adopting the default behavior.