You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
http://example.com/0/0/0.png // tile image for 0/0/0
21
15
http://example.com/0/0/0.grid.json // utfgrid for 0/0/0
22
16
http://example.com/layer.json // layer manifest
23
17
24
-
## layer.json
18
+
## TileJSON
25
19
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:
27
22
28
23
*`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**.
30
26
31
27
Example response from `layer.json`:
32
28
@@ -37,12 +33,35 @@ Example response from `layer.json`:
37
33
38
34
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.
39
35
40
-
### template
36
+
### Template
41
37
42
38
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
44
41
HTML, which will be cleaned with an HTML whitelist after generation.
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
+
46
65
### legend
47
66
48
67
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