Skip to content

Commit 4a44335

Browse files
committed
Detail the interaction changes more
1 parent 64fdfd0 commit 4a44335

File tree

1 file changed

+30
-11
lines changed

1 file changed

+30
-11
lines changed

1.1/interaction.md

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,20 @@ Tile servers can enhance tilesets with interactivity by implementing two additio
99

1010
Examples:
1111

12-
TMS-style URL schema
13-
14-
http://example.com/1.0.0/world/0/0/0.png // tile image for 0/0/0
15-
http://example.com/1.0.0/world/0/0/0.grid.json // utfgrid for 0/0/0
16-
http://example.com/1.0.0/world/layer.json // layer manifest
17-
1812
OSM-style URL schema
1913

2014
http://example.com/0/0/0.png // tile image for 0/0/0
2115
http://example.com/0/0/0.grid.json // utfgrid for 0/0/0
2216
http://example.com/layer.json // layer manifest
2317

24-
## layer.json
18+
## TileJSON
2519

26-
The layer manifest should provide a JSON object with the following keys:
20+
UTFGrid requires additions to the [TileJSON](https://github.com/mapbox/tilejson)
21+
payload for a layer:
2722

2823
* `template`: String. In the format of a mustache template.
29-
* `legend`: String. Self-contained HTML that may be displayed as a legend for this layer. **Optional**.
24+
* `legend`: String. Self-contained HTML that may be displayed as a legend for
25+
this layer. **Optional**.
3026

3127
Example response from `layer.json`:
3228

@@ -37,12 +33,35 @@ Example response from `layer.json`:
3733

3834
Each `layer.json` item should be represented by a single row in the `metadata` table where `key,value` match its key and value in the `layer.json` object.
3935

40-
### template
36+
### Template
4137

4238
As of UTFGrid 1.1, the `formatter` key is deprecated and replaced by `template`.
43-
Template is to be a [mustache](http://mustache.github.com/) format string that produces
39+
Template is to be a [mustache](http://mustache.github.com/) format string that
40+
produces
4441
HTML, which will be cleaned with an HTML whitelist after generation.
4542

43+
#### Mustache
44+
45+
Template data is specified according to the
46+
[mustache specification](http://mustache.github.com/mustache.5.html).
47+
The full specification is supported, but no partials are provided,
48+
or should be provided by implementations.
49+
50+
The template structure provides a section based on each format
51+
option. For instance, a formatter:
52+
53+
54+
{{#location}}
55+
http://your.com/{{id}}
56+
{{/location}}
57+
{{#full}}
58+
This content has the id {{id}}
59+
{{/full}}
60+
{{#teaser}}
61+
{{id}}
62+
{{/teaser}}
63+
64+
4665
### legend
4766

4867
A tileset may provide an HTML string that can be rendered by the client as a legend. The string should be self-contained and not reference external stylesheets, scripts or images. The [Data URI scheme](http://en.wikipedia.org/wiki/Data_URI_scheme) may be used to embed images or other data if necessary.

0 commit comments

Comments
 (0)