@mapbox/mapbox-gl-style-spec
TypeScript icon, indicating that this package has built-in type declarations

14.8.0 • Public • Published

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.

License

This project uses the standard Mapbox license, which is designed to provide flexibility for our customers and a sustained foundation for the development of our technology. Please consult LICENSE.txt for its specific details.

We understand that the Mapbox Style Specification embodied in this module may be useful in a wide variety of projects. If you are interested in using this module in a manner not expressly permitted by its license, please do not hesitate to contact legal@mapbox.com with details of what you have in mind.

Package Sidebar

Install

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

Weekly Downloads

163,693

Version

14.8.0

License

SEE LICENSE IN LICENSE.txt

Unpacked Size

3.9 MB

Total Files

126

Last publish

Collaborators

  • mbx-npm-ci-production
  • mbx-npm-ci-staging
  • mbx-npm-advanced-actions-production
  • mbx-npm-advanced-actions-staging
  • mbx-npm-09-production
  • mbx-npm-08-production
  • mbx-npm-07-production
  • mbx-npm-06-production
  • mbx-npm-05-production
  • mbx-npm-04-production
  • mbx-npm-03-production
  • mbx-npm-02-production
  • mbx-npm-01-production
  • mbx-npm-02-staging
  • mapbox-npm-01
  • mapbox-npm-02
  • mapbox-npm-07
  • mapbox-npm-03
  • mapbox-npm-04
  • mapbox-npm-09
  • mapbox-npm-05
  • mapbox-npm-06
  • mapbox-npm-08
  • mapbox-npm-advanced-actions
  • mapbox-npm-ci
  • mapbox-npm
  • mapbox-admin
  • mapbox-machine-user