Skip to content

Add road height field with unit dropdowns#8075

Merged
1ec5 merged 1 commit intodevelopfrom
1ec5-maxheight-units-3614
Oct 26, 2021
Merged

Add road height field with unit dropdowns#8075
1ec5 merged 1 commit intodevelopfrom
1ec5-maxheight-units-3614

Conversation

@1ec5
Copy link
Copy Markdown
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
@1ec5 1ec5 force-pushed the 1ec5-maxheight-units-3614 branch from ad8903e to 796537d Compare October 12, 2020 10:23
Comment thread data/presets.yaml Outdated
# maxheight=*
label: Max Height
# maxheight field placeholder
placeholder: '4, 4.5, 5, 14''0", 14''6", 15''0"'
Copy link
Copy Markdown
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.

Comment thread data/core.yaml
# symbol for meters
meter: m
# abbreviation of feet
foot: ft
Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread data/presets/schema/field.json Outdated
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
Copy Markdown
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 force-pushed the 1ec5-maxheight-units-3614 branch from cdb6317 to 39fe87a Compare October 25, 2021 07:09
@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