Browse files

Adding an example of a formatter

  • Loading branch information...
1 parent b33e7b1 commit 5ac63ff7cc74725987460f2f9daefaeaf4f06bc1 @tmcw tmcw committed Feb 11, 2011
Showing with 10 additions and 0 deletions.
  1. +10 −0 1.1/formatter.md
View
10 1.1/formatter.md
@@ -16,3 +16,13 @@ Only a single formatter is permitted per tileset. The formatter function can be
}
The `options` argument has one standardized property, `format`, which is expected to be a string, and all formatters must support two values, "teaser" and "full".
+
+### Example
+
+ function (options, data) {
+ if (options.format == 'teaser') {
+ return '<h1>' + data.NAME + '</h1>';
+ } else if (options.format == 'full') {
+ return '<h1>' + data.NAME + '</h1>' + data.AREA;
+ }
+ }

0 comments on commit 5ac63ff

Please sign in to comment.