mapnik-xml-to-mapbox-gl-json

0.0.2 • Public • Published

npm version

Mapnik XML to Mapbox GL JSON

Converts Mapnik XML styles into the Mapbox GL JSON format

Installation

$ npm install -g mapnik-xml-to-mapbox-gl-json

Or download source and run

$ npm install

Usage

mapnik-xml-to-mapbox-gl-json [settings file] [input XML file] [output JSON file]

$ ./bin/mapnik-xml-to-mapbox-gl-json bin/settings.json files/input.xml files/output.json

Optional flags

-v Validates generated JSON using mapbox-gl-style-lint

-c Adds an 'paint.hide-*' class to all layers where the asterix is the layers 'source-layer'

Conversion implementation

The converter does not support all Mapnik XML rules. Below are the rules that are converted to a corresponding Mapbox GL JSON style property:

  • Filter
  • MinScaleDenominator
  • MaxScaleDenominator
  • PolygonSymbolizer
  • LineSymbolizer
  • TextSymbolizer

Notice that all of the existing Mapnik XML parameters for these rules are not converted due to the lack of corresponding Mapbox GL JSON counterparts, or to the fact that they was not needed for our use case. Some parts are specific for our use case and needs modification to suit different Mapnik XMLs.

Readme

Keywords

none

Package Sidebar

Install

npm i mapnik-xml-to-mapbox-gl-json

Weekly Downloads

1

Version

0.0.2

License

MIT

Last publish

Collaborators

  • oskarer
  • emilrydkvist