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

Groups and Order of Fields in Layer Editor #21

Closed
2 tasks done
lukasmartinelli opened this issue Nov 24, 2016 · 1 comment
Closed
2 tasks done

Groups and Order of Fields in Layer Editor #21

lukasmartinelli opened this issue Nov 24, 2016 · 1 comment

Comments

@lukasmartinelli
Copy link
Collaborator

lukasmartinelli commented Nov 24, 2016

The layer editor is a very crucial part.

new_mockup_3

How it works now is that I just take all the fields from the spec for the layer type and then just displays the fields.
This does not work well for many fields.

Also properties can depend on each other! So some properties are not relevant if an other is active.

webpack_app

Given the different importance of properties and that they are related to each other means

  • Specify an order for the fields per layer type
  • Specify groups for fields per layer type

This order and groups can be declared in a JSON file and used together with the spec.

{
  "layerTypes": {
    "line": {
      "groups": [
        {
          "title": "Essentials",
          "fields": [
            "line-color",
            ...
          ]
        },
        {
          "title": "Options",
          "fields": [
            "line-dasharray",
            "line-gap-width",
            ...
          ]
        }
      ]
    },
    "fill": {
      "groups": [
        {
          "title": "Essentials",
          "fields": [
            "fill-color",
            "fill-pattern",
            "fill-opacity",
            "fill-translate"
          ]
        },
        {
          "title": "Stroke",
          "fields": [
            "fill-antialias",
            "fill-outline-color"
          ]
        }
      ]
    },
    ...
  }
}
@lukasmartinelli lukasmartinelli added this to the v0.1 Better Layer Editing milestone Nov 24, 2016
@lukasmartinelli lukasmartinelli removed this from the v0.1 Better Layer Editing milestone Dec 3, 2016
@lukasmartinelli lukasmartinelli added this to the v0.1 Layout and Design Language milestone Dec 22, 2016
@lukasmartinelli
Copy link
Collaborator Author

Fields per layer type and how they are grouped is configurable via a JSON file. https://github.com/maputnik/editor/blob/master/src/config/layout.json
This also allows creating custom configs to exclude properties that don't work e.g. with OpenLayers3.

screenshot from 2016-12-22 23-56-12

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

No branches or pull requests

1 participant