Skip to content
JSON specification of Mapnik styling and datasources
Branch: gh-pages
Clone or download
Latest commit 10a495d Jan 26, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
2.0.0 clean up last remaining unused 'api' properties Sep 24, 2014
2.0.1 clean up last remaining unused 'api' properties Sep 24, 2014
2.0.2 clean up last remaining unused 'api' properties Sep 24, 2014
2.1.0 remove * symbolizer completely from the reference Jul 5, 2017
2.1.1 remove * symbolizer completely from the reference Jul 5, 2017
2.2.0 remove 'auto' option from line-pattern and polygon-pattern since they… Jul 22, 2017
2.3.0 remove 'auto' option from line-pattern and polygon-pattern since they… Jul 22, 2017
3.0.0 shield-margin instead of text-margin in shield deprecation message Oct 7, 2018
3.0.20 bump to v8.10.0 Jan 26, 2019
3.0.22 bump to v8.10.0 Jan 26, 2019
3.0.3 shield-margin instead of text-margin in shield deprecation message Oct 7, 2018
3.0.6 shield-margin instead of text-margin in shield deprecation message Oct 7, 2018
scripts more datasource template fixes Oct 8, 2015
site Add files for Mapnik 3.0.22 Jan 22, 2019
test support for dynamically loading latest ref - refs #109 #108 Mar 5, 2016
.gitignore
.npmignore add to npm ignore Mar 5, 2016
.travis.yml update node versions for travis Feb 5, 2017
CHANGELOG.md
LICENSE.md Create LICENSE.md Feb 24, 2013
Makefile add to npm ignore Mar 5, 2016
README.md fix travis link, note new default branch Mar 5, 2016
contributing.md
generate.js correct lodash usage Jan 8, 2017
index._ add generated index.js to version control and remove generate command… May 26, 2017
index.html Add link to the Github repository from the reference site Sep 18, 2017
index.js Add files for Mapnik 3.0.22 Jan 22, 2019
package.json bump to v8.10.0 Jan 26, 2019

README.md

mapnik-reference

mapnik-reference is a spec of what Mapnik styling and datasource properties are supported for each version.

It is useful for building parsers, tests, compilers, and syntax highlighting/checking for languages.

Build Status

Default branch is gh-pages which is displayed at http://mapnik.org/mapnik-reference

Versioning

The version of this repository indicates the schema of the reference.json file. Schema changes of any type are expected to change the implementation requirements of a parser, so they will increment the major version of this repository in semver style.

The directories in this repository directly correspond to released versions of Mapnik and the next targeted release of Mapnik.

Meaning

The structure of the file is as such:

  • version: the version of Mapnik targeted. Same as the containing directory.
  • style: properties of the Style XML element
  • layer: properties of the Layer XML element
  • symbolizers/*: properties that apply to all symbolizers
  • symbolizers/symbolizer: properties that apply to each type of symbolizer
  • colors: named colors supported by Mapnik. see include/mapnik/css_color_grammar.hpp

Property stability

The status key may be used to define the stability of a property. When the key is not specified, then the status is stable. Possible values are:

  • stable: property is here to stay and its behavior is not anticipated to change
  • unstable: property is here to stay but its behavior/meaning of property may change
  • deprecated: property should not be used and will be removed in upcoming major version of Mapnik
  • experimental: property should not be used and may change, be re-named, or disappear at any time

Using

This is a valid npm module and therefore can easily be used with node.js.

npm install mapnik-reference

Install it as a dependency of your application. Then use that API to get a reference instance for a specific version of Mapnik:

var mapnik_reference = require('mapnik-reference');
var ref = mapnik_reference.load('3.0.0');

You can also get access to an array of all known versions:

var mapnik_reference = require('mapnik-reference');
mapnik_reference.versions;
[ '2.0.0',
  '2.0.1',
  '2.0.2',
  '2.1.0',
  '2.1.1',
  '2.2.0',
  '2.3.0',
  '3.0.0' ]

Other implementations will want to simply copy the JSON file from the desired implementation, like 2.0.1/reference.json.

The file can then be parsed with any of the many json parsers.

Testing

Tests require python and node.js:

make test

Users

  • carto.js
  • Mapnik itself (the util/validate-mapnik-instance.py is used to check binding consistency like in #1427)
You can’t perform that action at this time.