Skip to content

Commit f576ee2

Browse files
committed
Add resolution parameter
1 parent a59cea9 commit f576ee2

File tree

3 files changed

+217
-0
lines changed

3 files changed

+217
-0
lines changed

2.0.1/README.md

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# TileJSON 2.0.0
2+
3+
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
4+
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in
5+
this document are to be interpreted as described in RFC 2119.
6+
7+
## 1. Purpose
8+
9+
This specification attempts to create a standard for representing
10+
metadata about multiple types of web-based layers, to aid clients
11+
in configuration and browsing.
12+
13+
## 2. File format
14+
15+
TileJSON manifest files use the JSON format as described in RFC 4627.
16+
17+
Implementations MUST treat unknown keys as if they weren't present.
18+
However, implementations MUST expose unknown key/values in their API
19+
so that API users can optionally handle these keys. Implementations MUST
20+
treat invalid values for keys as if they weren't present. If the key is
21+
required, implementations MUST treat the entire TileJSON manifest file
22+
as invalid and refuse operation.
23+
24+
25+
```javascript
26+
{
27+
// REQUIRED. A semver.org style version number. Describes the version of
28+
// the TileJSON spec that is implemented by this JSON object.
29+
"tilejson": "2.0.0",
30+
31+
// OPTIONAL. Default: null. A name describing the tileset. The name can
32+
// contain any legal character. Implementations SHOULD NOT interpret the
33+
// name as HTML.
34+
"name": "compositing",
35+
36+
// OPTIONAL. Default: null. A text description of the tileset. The
37+
// description can contain any legal character. Implementations SHOULD NOT
38+
// interpret the description as HTML.
39+
"description": "A simple, light grey world.",
40+
41+
// OPTIONAL. Default: "1.0.0". A semver.org style version number. When
42+
// changes across tiles are introduces, the minor version MUST change.
43+
// This may lead to cut off labels. Therefore, implementors can decide to
44+
// clean their cache when the minor version changes. Changes to the patch
45+
// level MUST only have changes to tiles that are contained within one tile.
46+
// When tiles change significantly, the major version MUST be increased.
47+
// Implementations MUST NOT use tiles with different major versions.
48+
"version": "1.0.0",
49+
50+
// OPTIONAL. Default: null. Contains an attribution to be displayed
51+
// when the map is shown to a user. Implementations MAY decide to treat this
52+
// as HTML or literal text. For security reasons, make absolutely sure that
53+
// this field can't be abused as a vector for XSS or beacon tracking.
54+
"attribution": "<a href='http://openstreetmap.org'>OSM contributors</a>",
55+
56+
// OPTIONAL. Default: null. Contains a mustache template to be used to
57+
// format data from grids for interaction.
58+
// See https://github.com/mapbox/utfgrid-spec/tree/master/1.2
59+
// for the interactivity specification.
60+
"template": "{{#__teaser__}}{{NAME}}{{/__teaser__}}",
61+
62+
// OPTIONAL. Default: null. Contains a legend to be displayed with the map.
63+
// Implementations MAY decide to treat this as HTML or literal text.
64+
// For security reasons, make absolutely sure that this field can't be
65+
// abused as a vector for XSS or beacon tracking.
66+
"legend": "Dangerous zones are red, safe zones are green",
67+
68+
// OPTIONAL. Default: "xyz". Either "xyz" or "tms". Influences the y
69+
// direction of the tile coordinates.
70+
// The global-mercator (aka Spherical Mercator) profile is assumed.
71+
"scheme": "xyz",
72+
73+
// REQUIRED. An array of tile endpoints. {z}, {x} and {y} are replaced with
74+
// the corresponding integers. If multiple endpoints are specified, clients
75+
// may use any combination of endpoints. All endpoints MUST return the same
76+
// content for the same URL. The array MUST contain at least one endpoint.
77+
"tiles": [
78+
"http://localhost:8888/admin/1.0.0/world-light,broadband/{z}/{x}/{y}.png"
79+
],
80+
81+
// OPTIONAL. Default: []. An array of interactivity endpoints. {z}, {x}
82+
// and {y} are replaced with the corresponding integers. If multiple
83+
// endpoints are specified, clients may use any combination of endpoints.
84+
// All endpoints MUST return the same content for the same URL.
85+
// If the array doesn't contain any entries, interactivity is not supported
86+
// for this tileset.
87+
// See https://github.com/mapbox/mbtiles-spec/blob/master/1.1/interaction.md
88+
// for the interactivity specification.
89+
"grids": [
90+
"http://localhost:8888/admin/1.0.0/broadband/{z}/{x}/{y}.grid.json"
91+
],
92+
93+
// OPTIONAL. Default: 0. >= 0, <= 22.
94+
// An integer specifying the minimum zoom level.
95+
"minzoom": 0,
96+
97+
// OPTIONAL. Default: 22. >= 0, <= 22.
98+
// An integer specifying the maximum zoom level. MUST be >= minzoom.
99+
"maxzoom": 11,
100+
101+
// OPTIONAL. Default: 4
102+
// The pixel resolution of grids, if available, in px/grid square
103+
"resolution": 4,
104+
105+
// OPTIONAL. Default: [-180, -90, 180, 90].
106+
// The maximum extent of available map tiles. Bounds MUST define an area
107+
// covered by all zoom levels. The bounds are represented in WGS:84
108+
// latitude and longitude values, in the order left, bottom, right, top.
109+
// Values may be integers or floating point numbers.
110+
"bounds": [ -180, -85.05112877980659, 180, 85.0511287798066 ],
111+
112+
// OPTIONAL. Default: null.
113+
// The first value is the longitude, the second is latitude (both in
114+
// WGS:84 values), the third value is the zoom level as an integer.
115+
// Longitude and latitude MUST be within the specified bounds.
116+
// The zoom level MUST be between minzoom and maxzoom.
117+
// Implementations can use this value to set the default location. If the
118+
// value is null, implementations may use their own algorithm for
119+
// determining a default location.
120+
"center": [ -76.275329586789, 39.153492567373, 8 ]
121+
}
122+
```
123+
124+
125+
## 3. Caching
126+
127+
Clients MAY cache files retrieved from a remote server.
128+
When implementations decide to perform caching, they MUST honor valid
129+
cache control HTTP headers as defined in the HTTP specification for both
130+
tile images and the TileJSON manifest file.

2.0.1/example/osm.layer

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"tilejson": "1.0.0",
3+
"name": "OpenStreetMap",
4+
"description": "A free editable map of the whole world.",
5+
"version": "1.0.0",
6+
"attribution": "(c) OpenStreetMap contributors, CC-BY-SA",
7+
"scheme": "xyz",
8+
"tiles": [
9+
"http://a.tile.openstreetmap.org/${z}/${x}/${y}.png",
10+
"http://b.tile.openstreetmap.org/${z}/${x}/${y}.png",
11+
"http://c.tile.openstreetmap.org/${z}/${x}/${y}.png"
12+
],
13+
"minzoom": 0,
14+
"maxzoom": 18,
15+
"bounds": [ -180, -85, 180, 85 ]
16+
}

2.0.1/schema.json

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
{
2+
"name": "TileJSON",
3+
"type": "object",
4+
"properties": {
5+
"tilejson": {
6+
"type": "string",
7+
"required": true,
8+
"pattern": "\\d+\\.\\d+\\.\\d+\\w?[\\w\\d]*"
9+
},
10+
"name": {
11+
"type": "string"
12+
},
13+
"description": {
14+
"type": "string"
15+
},
16+
"version": {
17+
"type": "string",
18+
"pattern": "\\d+\\.\\d+\\.\\d+\\w?[\\w\\d]*"
19+
},
20+
"attribution": {
21+
"type": "string"
22+
},
23+
"template": {
24+
"type": "string"
25+
},
26+
"legend": {
27+
"type": "string"
28+
},
29+
"scheme": {
30+
"type": "string"
31+
},
32+
"tiles": {
33+
"type": "array",
34+
"required": true,
35+
"items": {
36+
"type": "string"
37+
}
38+
},
39+
"grids": {
40+
"type": "array",
41+
"items": {
42+
"type": "string"
43+
}
44+
},
45+
"resolution": {
46+
"type": "integer"
47+
},
48+
"minzoom": {
49+
"minimum": 0,
50+
"maximum": 22,
51+
"type": "integer"
52+
},
53+
"maxzoom": {
54+
"minimum": 0,
55+
"maximum": 22,
56+
"type": "integer"
57+
},
58+
"bounds": {
59+
"type": "array",
60+
"items": {
61+
"type": "number"
62+
}
63+
},
64+
"center": {
65+
"type": "array",
66+
"items": {
67+
"type": "number"
68+
}
69+
}
70+
}
71+
}

0 commit comments

Comments
 (0)