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 road height field with unit dropdowns #8075

Merged
merged 1 commit into from
Oct 26, 2021
Merged

Conversation

1ec5
Copy link
Collaborator

@1ec5 1ec5 commented Oct 12, 2020

Implemented the roadheight field type based on the roadspeed field type. The new field has an explicit option to choose the unit of measurement (between meters and feet). When the field is set to feet, an additional input box lights up to allow the user to enter inches separately.

Initial state in Vietnam:
vn

maxheight=4.8:
m

Initial state in the U.S.:
us

maxheight=12':
ft

maxheight=12'6":
ft in

maxheight=36":
in

maxheight=below_default:
below_default

Multiple selection:
multiple

Fixes #3614. Depends on rapideditor/country-coder#30.

@1ec5 1ec5 added localization Adapting iD across languages, regions, and cultures field An issue with a field in the user interface labels Oct 12, 2020
@1ec5 1ec5 self-assigned this Oct 12, 2020
@@ -1436,8 +1436,6 @@ en:
maxheight:
# maxheight=*
label: Max Height
# maxheight field placeholder
placeholder: '4, 4.5, 5, 14''0", 14''6", 15''0"'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This placeholder could probably be restored, but rewritten so that it only encourages the use of . as a decimal separator but doesn’t encourage putting ' and " directly in the field.

# symbol for meters
meter: m
# abbreviation of feet
foot: ft
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These abbreviations are already present in the YAML file, but only as part of format strings:

iD/data/core.yaml

Line 2278 in bb56584

feet: "{quantity} ft"

In theory, we could reuse those strings to decide whether to display the unit dropdown to the left or right of the input box, but I don’t know if any language needs that extra complexity.

@1ec5
Copy link
Collaborator Author

1ec5 commented Oct 12, 2020

Regarding #7129 (comment), I think we could generalize this field to cover the other length fields (Height, Length, Width, and Elevation). However, if we ever add fields for attraction:minheight and attraction:maxheight, they’ll need a separate custom field because some countries measure human heights with different units than vehicle or building heights.

data/presets/schema/field.json Outdated Show resolved Hide resolved
quincylvania added a commit to ideditor/schema-builder that referenced this pull request Nov 25, 2020
Add `roadheight` field type for openstreetmap/iD#8075
Add `locationSet` info to the readme
@quincylvania quincylvania added this to the 2.20.0 milestone Dec 9, 2020
@mbrzakovic mbrzakovic removed this from the 2.20.0 milestone Jul 13, 2021
@1ec5
Copy link
Collaborator Author

1ec5 commented Sep 19, 2021

The new maxheight field type would be useful for openstreetmap/id-tagging-schema#232 as well.

@1ec5 1ec5 force-pushed the 1ec5-maxheight-units-3614 branch 2 times, most recently from 000f0ad to cdb6317 Compare October 25, 2021 06:55
@1ec5 1ec5 changed the title Add unit dropdowns to maxheight field Add road height field with unit dropdowns Oct 25, 2021
@1ec5 1ec5 merged commit 5f58b53 into develop Oct 26, 2021
@1ec5 1ec5 deleted the 1ec5-maxheight-units-3614 branch October 26, 2021 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
field An issue with a field in the user interface localization Adapting iD across languages, regions, and cultures
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Max Height field should have separate unit dropdown
3 participants