Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Feb 28, 2023

Conversation

treestryder
Copy link
Contributor

@treestryder treestryder commented Feb 27, 2023

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.

…restriction and seamark:bridge:clearance_height.
@plepe
Copy link
Owner

plepe commented Feb 27, 2023

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
Copy link
Contributor Author

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
Copy link
Owner

plepe commented Feb 27, 2023

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

@treestryder
Copy link
Contributor Author

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".

@plepe plepe merged commit 79823a2 into plepe:master Feb 28, 2023
@treestryder treestryder deleted the paddling-hazards branch February 28, 2023 19:39
@treestryder
Copy link
Contributor Author

Thank you.

@plepe
Copy link
Owner

plepe commented Feb 28, 2023

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
Copy link
Contributor Author

treestryder commented Feb 28, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants