JSPM

  • Created
  • Published
  • Downloads 223173
  • Score
    100M100P100Q196597F
  • License ISC

a specification for mapbox gl styles

Package Exports

  • @mapbox/mapbox-gl-style-spec
  • @mapbox/mapbox-gl-style-spec/deref
  • @mapbox/mapbox-gl-style-spec/diff
  • @mapbox/mapbox-gl-style-spec/feature_filter
  • @mapbox/mapbox-gl-style-spec/function
  • @mapbox/mapbox-gl-style-spec/reference/latest

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@mapbox/mapbox-gl-style-spec) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Mapbox GL Spec & Lint

Circle CI

GL style spec, validation, and migration scripts for mapbox-gl-js and mapbox-gl-native.

Install

npm install -g mapbox-gl-style-spec

Provides the utilities:

  • gl-style-migrate
  • gl-style-format
  • gl-style-validate

Validation

$ gl-style-validate style.json

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

Migrations

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

API

Tests

To run tests:

npm install
npm test

To update test fixtures

UPDATE=true npm test

Documentation

  • The utility reference page API.md is generated automatically from inline source documentation.
  • The style reference page exists here: docs/_generate/index.html and can be edited directly.

To view the documentation, run

npm start

and open the served page

open http://127.0.0.1:4000/mapbox-gl-style-spec