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

Produce nicer style formatting #7029

Merged
merged 1 commit into from
Jul 30, 2018
Merged

Produce nicer style formatting #7029

merged 1 commit into from
Jul 30, 2018

Conversation

mourner
Copy link
Member

@mourner mourner commented Jul 26, 2018

Makes the format function in the style-spec package produce nicer, more readable style JSON. Before:

"text-size": [
    "interpolate",
    [
        "linear"
    ],
    [
        "zoom"
    ],
    2,
    [
        "step",
        [
            "get",
            "scalerank"
        ],
        13,
        3,
        11,
        5,
        9
    ],
    9,
    [
        "step",
        [
            "get",
            "scalerank"
        ],
        35,
        3,
        27,
        5,
        22
    ]
]

After:

"text-size": [
    "interpolate",
    ["linear"],
    ["zoom"],
    2,
    ["step", ["get", "scalerank"], 13, 3, 11, 5, 9],
    9,
    ["step", ["get", "scalerank"], 35, 3, 27, 5, 22]
]

cc @samanpwbb not sure if this needs any actions on the Studio side. Just wanted to make the downloaded styles in Studio easier to read.

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality (formatting doesn't need to be tested)
  • document any changes to public APIs no changes

@mourner mourner merged commit 8f8f382 into master Jul 30, 2018
@mourner mourner deleted the nicer-style-format branch July 30, 2018 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants