Skip to content
Branch: master
Find file History
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
bin
dist Fix packaging issues with style-spec package Oct 27, 2017
error Allow canvas source initialization from HTML element Apr 11, 2018
expression Fix buggy image coercion so image names resolve correctly (#8839) Oct 9, 2019
feature_filter Use eslint object-curly-spacing to enforce no extra space in curly br… Aug 28, 2019
function
migrate
reference
util Use eslint object-curly-spacing to enforce no extra space in curly br… Aug 28, 2019
validate
.eslintrc
CHANGELOG.md Merge release-ristretto into master (#8823) Sep 30, 2019
README.md Add api-supported-mode to spec.validate (#8663) Sep 25, 2019
composite.js Switch to ES modules and Rollup (#6196) Mar 12, 2018
declass.js Switch to ES modules and Rollup (#6196) Mar 12, 2018
deref.js
diff.js Use eslint object-curly-spacing to enforce no extra space in curly br… Aug 28, 2019
format.js get rid of sort-object dependency (#7065) Aug 1, 2018
group_by_layout.js [] add a cache to style-layer-index so we don't recalculate keys (#8122) Jun 4, 2019
migrate.js Add migration to expressions into gl-style-migrate Aug 23, 2018
package.json Merge release-ristretto into master (#8823) Sep 30, 2019
read_style.js Add api-supported-mode to spec.validate (#8663) Sep 25, 2019
rollup.config.js Cherry pick style-spec build fixes from master (#6603) May 3, 2018
style-spec.js Add api-supported-mode to spec.validate (#8663) Sep 25, 2019
types.js
validate_mapbox_api_supported.js Add api-supported-mode to spec.validate (#8663) Sep 25, 2019
validate_style.js Add api-supported-mode to spec.validate (#8663) Sep 25, 2019
validate_style.min.js Add api-supported-mode to spec.validate (#8663) Sep 25, 2019
visit.js Upgrade lint-related dependencies (#7463) Nov 1, 2018

README.md

Mapbox GL style specification & utilities

This directory contains code and reference files that define the Mapbox GL style specification and provides some utilities for working with Mapbox styles.

npm package

The Mapbox GL style specification and utilities are published as a seperate npm package so that they can be installed without the bulk of GL JS.

npm install @mapbox/mapbox-gl-style-spec

CLI Tools

If you install this package globally, you will have access to several CLI tools.

npm install @mapbox/mapbox-gl-style-spec --global

gl-style-composite

$ gl-style-composite style.json

Will take a non-composited style and produce a composite style.

gl-style-migrate

This repo contains scripts for migrating GL styles of any version to the latest version (currently v8). Migrate a style like this:

$ gl-style-migrate bright-v7.json > bright-v8.json

To migrate a file in place, you can use the sponge utility from the moreutils package:

$ brew install moreutils
$ gl-style-migrate bright.json | sponge bright.json

gl-style-format

$ gl-style-format style.json

Will format the given style JSON to use standard indentation and sorted object keys.

gl-style-validate

$ gl-style-validate style.json

Will validate the given style JSON and print errors to stdout. Provide a --json flag to get JSON output.

To validate that a style can be uploaded to the Mapbox Styles API, use the --mapbox-api-supported flag.

You can’t perform that action at this time.