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

Preset field inheritance #5710

Closed
quincylvania opened this issue Jan 14, 2019 · 0 comments · Fixed by #5712
Closed

Preset field inheritance #5710

quincylvania opened this issue Jan 14, 2019 · 0 comments · Fixed by #5712
Labels
field An issue with a field in the user interface preset An issue with an OpenStreetMap preset or tag

Comments

@quincylvania
Copy link
Collaborator

There is a lot of duplicated field data in the presets. For instance, most of the shop presets have the same fields:

    "fields": [
        "name",
        "operator",
        "address",
        "building_area",
        "opening_hours",
        "payment_multi"
    ]

If we want to change this default list, we need to do it dozens of times to be consistent. This issue is compounded by the new moreFields property.

The presets should inherit their fields and moreFields properties from the "parent" preset if they are not manually defined. For instance, shop/convenience should automatically take the fields of shop if the user doesn't provide more explicit values.

A special field value such as {inherit} could allow for adding onto the inherited fields, like so:

{
    "icon": "maki-clothing-store",
    "fields": [
        "{inherit}",
        "clothes"
    ],
    "geometry": [
        "point",
        "area"
    ],
    "tags": {
        "shop": "clothes"
    },
    "name": "Clothing Store"
}

An alternative solution would be to allow targeting a specific preset, but I think "parent" inheritance fits most cases.

@quincylvania quincylvania added preset An issue with an OpenStreetMap preset or tag field An issue with a field in the user interface labels Jan 14, 2019
@bhousel bhousel added the wip Work in progress label Jan 15, 2019
@bhousel bhousel removed the wip Work in progress label Jan 14, 2020
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 preset An issue with an OpenStreetMap preset or tag
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants