-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
FeaturePanel: Arrow for direction
tag
#592
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🔍 Existing Issues For ReviewYour pull request is modifying functions with the following pre-existing issues: 📄 File: src/components/FeaturePanel/Properties/renderValue.tsx
Did you find this useful? React with a 👍 or 👎 |
case 'W': | ||
return 270; | ||
default: | ||
throw new Error('Invalid'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest returning a null
here, because value in OSM can be very creative. Let's don't stop entire application, but just hide the direction indicator.
In general - exceptions are meant for app states we really don't expect. User input usually shouldn't throw an exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Often there are directions that aren't cardinal e.g. on road signs backward
and forward
is used.
This will throw here and will be catched in DirectionValue
a few lines lower.
In my opinion this is the easiest way to cancel the arrow rendering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, can you add examples of features with direction in the PR description? also with the range? thx.
Description
Add a arrow for the direction tag. This fixes #590
### examples:
-15
broken)