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

13.24.0-alpha.9 • Public • Published

Mapbox GL style specification & utilities

This package is a temporary, source code identical fork of @mapbox/mapbox-gl-style-spec, maintained by OpenLayers contributors. It provides separate exports for all of its modules, and a style spec without docs and examples to reduce build sizes. When #11628 is merged, this package will be obsolete.

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

In addition to ESM and CJS bundles, the package also provides separate modules. The difference between the bundles and the modules is that the modules use a minified version of the latest style refererence, which does not contain any doc and example fields. See the exports section of package.json for available modules.

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.

Dependents (0)

Package Sidebar

Install

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

Weekly Downloads

1

Version

13.24.0-alpha.9

License

ISC

Unpacked Size

3.45 MB

Total Files

221

Last publish

Collaborators

  • tschaub
  • ahocevar