Go to file
2011-01-31 17:35:35 -05:00
bin simplify filter.val 2011-01-30 17:20:17 -05:00
build (doc) comments 2010-06-15 18:56:16 -04:00
files Catch syntax errors. Also, don't let comment regex make weird behavior. Also, only let error() record, never let it throw. 2011-01-24 18:32:18 -05:00
lib/mess Merge branch 'master' of github.com:developmentseed/mess.js 2011-01-31 17:35:35 -05:00
test move afghanistan to renderer test, as it is no longer a benchmark :) 2011-01-31 12:11:17 -05:00
.gitignore make paths relative to root of repository 2011-01-25 14:45:07 -05:00
.ndistro add node-zipfile to ndistro 2011-01-24 12:37:50 -05:00
LICENSE moved to apache license 2010-03-04 14:46:41 -05:00
Makefile only run *.test.js tests 2011-01-26 18:09:27 -05:00
package.json add more dependencies to package.json 2011-01-20 18:50:01 -05:00
README.md Switching to new, better readme 2011-01-31 17:34:10 -05:00

mess.js

Is a stylesheet renderer for Mapnik. It's an evolution of the Cascadenik idea and language, with an emphasis on speed and flexibility.

MML

incompatibility

  • MML files are assumed to be JSON, not XML

Attachments

new

In CSS, a certain object can only have one instance of a property. A <div> has a specific border width and color, rules that match better than others (#id instead of .class) override previous definitions. mess.js acts the same way normally for the sake of familiarity and organization, but Mapnik itself is more powerful.

Layers in Mapnik can have multiple borders and multiple copies of other attributes. This ability is useful in drawing line outlines, like in the case of road borders or 'glow' effects around coasts. mess.js makes this accessible by allowing attachments to styles:

#world {
  line-color: #fff;
  line-width: 3;
  }

  #world::outline {
    line-color: #000;
    line-width: 6;
    }

Attachments are optional: if you don't define them, mess.js does overriding of styles just like Cascadenik.

This brings us to another incompatibility: line-inline and line-outline have been removed from the language, because attachments are capable of the same trick.

text-name

incompatibility

Instead of the name attribute of the TextSymbolizer and ShieldSymbolizer being a part of the selector, it is a property of a rule. Thus the evaluation is less complex and one can use expressions in names.

cascadenik mess.js
#world NAME {
  text-face-name: "Arial";
}
#world {
  text-name: "NAME";
  text-face-name: "Arial";
}

Mapnik2

mess.js is only compatible with Mapnik2. Compatibility with Mapnik 0.7.x is not planned.

Rasters and Buildings

Rasters are supported in mess.js - it knows how to download .vrt, .tiff, and soon other raster formats, and the properties of the RasterSymbolizer are exposed in the language.

The BuildingSymbolizer is also supported in mess.js. The code stores symbolizer types and properties in a JSON file (in tree/reference.js), so new Mapnik features can be quickly implemented here.

Variables & Expressions

mess.js inherits from its basis in less.js some new features in CSS. One can define variables in stylesheets, and use expressions to modify them.

@mybackground: #2B4D2D;

Map {
  background-color: @mybackground
}

#world {
  polygon-fill: @mybackground + #222;
  line-color: darken(@mybackground, 10%);
}

FontSets

By defining multiple fonts in a text-face-name definition, you create FontSets in mess.js. These are useful for supporting multiple character sets and fallback fonts for distributed styles.

Credits

mess.js is based on less.js, a CSS compiler written by Alexis Sellier. It depends on underscore.js.

Usage

Using the binary

messc map_file.json

Authors

  • Tom MacWright (tmcw)
  • Konstantin Käfer (kkaefer)
  • AJ Ashton (ajashton)