Skip to content
This repository
Browse code

Adding an example of a formatter

  • Loading branch information...
commit 5ac63ff7cc74725987460f2f9daefaeaf4f06bc1 1 parent b33e7b1
Tom MacWright authored

Showing 1 changed file with 10 additions and 0 deletions. Show diff stats Hide diff stats

  1. +10 0 1.1/formatter.md
10 1.1/formatter.md
Source Rendered
@@ -16,3 +16,13 @@ Only a single formatter is permitted per tileset. The formatter function can be
16 16 }
17 17
18 18 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".
  19 +
  20 +### Example
  21 +
  22 + function (options, data) {
  23 + if (options.format == 'teaser') {
  24 + return '<h1>' + data.NAME + '</h1>';
  25 + } else if (options.format == 'full') {
  26 + return '<h1>' + data.NAME + '</h1>' + data.AREA;
  27 + }
  28 + }

0 comments on commit 5ac63ff

Please sign in to comment.
Something went wrong with that request. Please try again.