67.2 GB
208,150 files
Updated about 2 months ago
Name
Size
bin
dist
error
expression
feature_filter
function
migrate
reference
util
validate
.eslintrc71 Bytes
xet
CHANGELOG.md23.1 kB
xet
README.md1.6 kB
xet
composite.js1.21 kB
xet
declass.js1.27 kB
xet
deref.js1.22 kB
xet
diff.js13.8 kB
xet
empty.js686 Bytes
xet
format.js1.56 kB
xet
group_by_layout.js1.95 kB
xet
migrate.js877 Bytes
xet
package.json1.24 kB
xet
read_style.js408 Bytes
xet
rollup.config.js2.25 kB
xet
style-spec.js3.36 kB
xet
types.js17.9 kB
xet
validate_mapbox_api_supported.js5.54 kB
xet
validate_style.js1.27 kB
xet
validate_style.min.js2.51 kB
xet
visit.js2.42 kB
xet
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.

Total size
67.2 GB
Files
208,150
Last updated
Sep 27
Pre-warmed CDN
US EU US EU

Contributors