From 27020daf5cf0f029e1bbbef7734ad6470417ece8 Mon Sep 17 00:00:00 2001 From: gretacb Date: Mon, 30 Jul 2018 15:26:46 -0500 Subject: [PATCH 01/13] Add note on grid interactivity --- 3.0.0/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/3.0.0/README.md b/3.0.0/README.md index 7c51d4a..db46184 100644 --- a/3.0.0/README.md +++ b/3.0.0/README.md @@ -120,6 +120,8 @@ OPTIONAL. Default: []. An array of interactivity endpoints. {z}, {x} and {y}, if present, are replaced with the corresponding integers. If multiple endpoints are specified, clients may use any combination of endpoints. All endpoints MUST return the same content for the same URL. If the array doesn't contain any entries, UTF-Grid interactivity is not supported for this tileset. See https://github.com/mapbox/utfgrid-spec/tree/master/1.2 for the interactivity specification. +*Note: UTF-Grid interactivity predates GL-based map rendering and interaction. Map interactivity is now generally defined outside of the TileJSON specification and is dependent on the tile rendering library's features.* + ```JSON { "grids": [ From 9ef00ae9ac4489cc149def1f4ede29fab3eb2765 Mon Sep 17 00:00:00 2001 From: gretacb Date: Mon, 30 Jul 2018 15:30:53 -0500 Subject: [PATCH 02/13] Ensure integers are integers in the examples --- 3.0.0/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/3.0.0/README.md b/3.0.0/README.md index db46184..a1bdc89 100644 --- a/3.0.0/README.md +++ b/3.0.0/README.md @@ -110,7 +110,7 @@ For example, in a tileset with maxzoom 10 and _no_ fillzoom specified, if a requ ```JSON { - "fillzoom": "8" + "fillzoom": 8 } ``` @@ -150,7 +150,7 @@ An integer specifying the maximum zoom level. MUST be >= minzoom. ```JSON { - "maxzoom": "11" + "maxzoom": 11 } ``` @@ -162,7 +162,7 @@ An integer specifying the minimum zoom level. MUST be <= maxzoom ```JSON { - "minzoom": "0" + "minzoom": 0 } ``` From 7c6ff2935850d271e6d368fb620e2761f9130f32 Mon Sep 17 00:00:00 2001 From: gretacb Date: Mon, 30 Jul 2018 15:45:01 -0500 Subject: [PATCH 03/13] Consistify use of TileJSON and consistify fillzoom json example with the spec description --- 3.0.0/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/3.0.0/README.md b/3.0.0/README.md index a1bdc89..358b596 100644 --- a/3.0.0/README.md +++ b/3.0.0/README.md @@ -106,11 +106,11 @@ OPTIONAL. Default: null. An integer specifying the zoom level at which to generate overzoomed tiles from. Implementations may generate overzoomed tiles from parent tiles if the requested zoom level does not exist. In most cases, overzoomed tiles are generated from the maximum zoom level of the tileset. If fillzoom is specified, the overzoomed tile is generated from the fillzoom level. -For example, in a tileset with maxzoom 10 and _no_ fillzoom specified, if a request for a z11 tile comes through, the implementation will use the maximum z10 parent tiles to generate the new, overzoomed z11 tile. If the same tilejson had fillzoom specified at z7, a request for a z11 tile would use the z7 tile instead of z10. +For example, in a tileset with maxzoom 10 and _no_ fillzoom specified, if a request for a z11 tile comes through, the implementation will use the maximum z10 parent tiles to generate the new, overzoomed z11 tile. If the same TileJSON object had fillzoom specified at z7, a request for a z11 tile would use the z7 tile instead of z10. ```JSON { - "fillzoom": 8 + "fillzoom": 7 } ``` From 4961b17512dedabef8d70b0a8a2c1083dca5b610 Mon Sep 17 00:00:00 2001 From: gretacb Date: Mon, 30 Jul 2018 16:30:25 -0500 Subject: [PATCH 04/13] Ensure tile endpoints are absolute urls --- 3.0.0/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3.0.0/README.md b/3.0.0/README.md index 358b596..4de5d95 100644 --- a/3.0.0/README.md +++ b/3.0.0/README.md @@ -218,7 +218,7 @@ A semver.org style version number as a string. Describes the version of the Tile REQUIRED. -An array of tile endpoints. {z}, {x} and {y}, if present, are replaced with the corresponding integers. If multiple endpoints are specified, clients may use any combination of endpoints. All endpoints MUST return the same content for the same URL. The array MUST contain at least one endpoint. The tile extension is NOT limited to any particular format. Some of the more popular are: mvt, vector.pbf, png, webp, and jpg. +An array of tile endpoints. {z}, {x} and {y}, if present, are replaced with the corresponding integers. If multiple endpoints are specified, clients may use any combination of endpoints. All endpoint urls MUST be absolute. All endpoints MUST return the same content for the same URL. The array MUST contain at least one endpoint. The tile extension is NOT limited to any particular format. Some of the more popular are: mvt, vector.pbf, png, webp, and jpg. ```JSON { From be180659d844851ee3fbed387d07c9938b5582eb Mon Sep 17 00:00:00 2001 From: gretacb Date: Mon, 30 Jul 2018 16:36:14 -0500 Subject: [PATCH 05/13] Use set of tiles instead of tileset --- 3.0.0/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/3.0.0/README.md b/3.0.0/README.md index 4de5d95..8c7bc9e 100644 --- a/3.0.0/README.md +++ b/3.0.0/README.md @@ -92,7 +92,7 @@ An array of data files in GeoJSON format. {z}, {x} and {y}, if present, are repl OPTIONAL. Default: null. -A text description of the tileset. The description can contain any valid unicode character as described by the JSON specification [RFC 8259](https://tools.ietf.org/html/rfc8259). +A text description of the set of tiles. The description can contain any valid unicode character as described by the JSON specification [RFC 8259](https://tools.ietf.org/html/rfc8259). ```JSON { @@ -104,9 +104,9 @@ A text description of the tileset. The description can contain any valid unicode OPTIONAL. Default: null. -An integer specifying the zoom level at which to generate overzoomed tiles from. Implementations may generate overzoomed tiles from parent tiles if the requested zoom level does not exist. In most cases, overzoomed tiles are generated from the maximum zoom level of the tileset. If fillzoom is specified, the overzoomed tile is generated from the fillzoom level. +An integer specifying the zoom level at which to generate overzoomed tiles from. Implementations may generate overzoomed tiles from parent tiles if the requested zoom level does not exist. In most cases, overzoomed tiles are generated from the maximum zoom level of the set of tiles. If fillzoom is specified, the overzoomed tile is generated from the fillzoom level. -For example, in a tileset with maxzoom 10 and _no_ fillzoom specified, if a request for a z11 tile comes through, the implementation will use the maximum z10 parent tiles to generate the new, overzoomed z11 tile. If the same TileJSON object had fillzoom specified at z7, a request for a z11 tile would use the z7 tile instead of z10. +For example, in a set of tiles with maxzoom 10 and _no_ fillzoom specified, if a request for a z11 tile comes through, the implementation will use the maximum z10 parent tiles to generate the new, overzoomed z11 tile. If the same TileJSON object had fillzoom specified at z7, a request for a z11 tile would use the z7 tile instead of z10. ```JSON { @@ -118,7 +118,7 @@ For example, in a tileset with maxzoom 10 and _no_ fillzoom specified, if a requ OPTIONAL. Default: []. -An array of interactivity endpoints. {z}, {x} and {y}, if present, are replaced with the corresponding integers. If multiple endpoints are specified, clients may use any combination of endpoints. All endpoints MUST return the same content for the same URL. If the array doesn't contain any entries, UTF-Grid interactivity is not supported for this tileset. See https://github.com/mapbox/utfgrid-spec/tree/master/1.2 for the interactivity specification. +An array of interactivity endpoints. {z}, {x} and {y}, if present, are replaced with the corresponding integers. If multiple endpoints are specified, clients may use any combination of endpoints. All endpoints MUST return the same content for the same URL. If the array doesn't contain any entries, UTF-Grid interactivity is not supported for this set of tiles. See https://github.com/mapbox/utfgrid-spec/tree/master/1.2 for the interactivity specification. *Note: UTF-Grid interactivity predates GL-based map rendering and interaction. Map interactivity is now generally defined outside of the TileJSON specification and is dependent on the tile rendering library's features.* @@ -170,7 +170,7 @@ An integer specifying the minimum zoom level. MUST be <= maxzoom OPTIONAL. Default: null. -A name describing the tileset. The name can contain any legal character. Implementations SHOULD NOT interpret the name as HTML. +A name describing the set of tiles. The name can contain any legal character. Implementations SHOULD NOT interpret the name as HTML. ```JSON { @@ -256,9 +256,9 @@ A string representing a human-readable description of the entire layer's content OPTIONAL. -A number representing the lowest/highest zoom level whose tiles this layer appears in. `minzoom` MUST be greater than or equal to the tileset's `minzoom`. `maxzoom` MUST be less than or equal to the tileset's `maxzoom`. +A number representing the lowest/highest zoom level whose tiles this layer appears in. `minzoom` MUST be greater than or equal to the set of tiles' `minzoom`. `maxzoom` MUST be less than or equal to the set of tiles' `maxzoom`. -These keys are used to describe the situation where different sets of vector layers appear in different zoom levels of the same tileset, for example in a case where a "minor roads" layer is only present at high zoom levels. +These keys are used to describe the situation where different sets of vector layers appear in different zoom levels of the same set of tiles, for example in a case where a "minor roads" layer is only present at high zoom levels. ```JSON { From c53930463ab33cf6eee822607581d1806c487566 Mon Sep 17 00:00:00 2001 From: mapsam Date: Mon, 30 Jul 2018 15:44:23 -0700 Subject: [PATCH 06/13] keys and values --- 3.0.0/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/3.0.0/README.md b/3.0.0/README.md index 8c7bc9e..91ec64b 100644 --- a/3.0.0/README.md +++ b/3.0.0/README.md @@ -36,13 +36,13 @@ TileJSON manifest files use the JSON format as described in [RFC 8259](https://t # 3. Structure -Implementations MUST treat unknown keys as if they weren't present. However, implementations MUST expose unknown key/values so users can optionally handle these keys. Implementations MUST treat invalid values for keys as if they weren’t present. If the the field is an optional field and the value is invalid, the default value MAY be applied. If the key is required, implementations MUST treat the entire TileJSON manifest file as invalid and refuse operation. +Implementations MUST treat unknown keys as if they weren't present. However, implementations MUST expose unknown key value pairs so users can optionally handle these keys. Implementations MUST treat invalid values for keys as if they weren’t present. If the the key is optional and the value is invalid, the default value MAY be applied. If the key is required, implementations MUST treat the entire TileJSON manifest file as invalid and refuse operation. ## 3.1 `attribution` OPTIONAL. Default: null. -Contains an attribution to be displayed when the map is shown to a user. Implementations MAY decide to treat this as HTML or literal text. For security reasons, make absolutely sure that this field can't be abused as a vector for XSS or beacon tracking. +Contains an attribution to be displayed when the map is shown to a user. Implementations MAY decide to treat this as HTML or literal text. For security reasons, make absolutely sure that this content can't be abused as a vector for XSS or beacon tracking. ```JSON { @@ -244,7 +244,7 @@ A string value representing the the layer id. For added context, this is referre REQUIRED. -A JSON object whose keys and values are the names and descriptions of attributes available in this layer. Each value (description) MUST be a string that describes the underlying data. If no fields are present the `fields` key MUST be an empty object. +A JSON object whose keys and values are the names and descriptions of attributes available in this layer. Each value (description) MUST be a string that describes the underlying data. If no fields are present, the `fields` key MUST be an empty object. #### 3.15.3 `description` From 5ccdb6ac3b8dbba3c1fd2eec842776cf3c4cf9ab Mon Sep 17 00:00:00 2001 From: mapsam Date: Mon, 30 Jul 2018 15:51:23 -0700 Subject: [PATCH 07/13] update section order & put required first --- 3.0.0/README.md | 249 ++++++++++++++++++++++++------------------------ 1 file changed, 124 insertions(+), 125 deletions(-) diff --git a/3.0.0/README.md b/3.0.0/README.md index 91ec64b..6340e9f 100644 --- a/3.0.0/README.md +++ b/3.0.0/README.md @@ -7,23 +7,23 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "S 1. [Purpose](#1-purpose) 1. [File format](#2-file-format) 1. [Structure](#3-structure) - 1. [attribution](#31-attribution) - 1. [bounds](#32-bounds) - 1. [center](#33-center) - 1. [data](#34-data) - 1. [description](#35-description) - 1. [fillzoom](#36-fillzoom) - 1. [grids](#36-grids) - 1. [legend](#37-legend) - 1. [maxzoom](#38-maxzoom) - 1. [minzoom](#39-minzoom) - 1. [name](#310-name) - 1. [scheme](#311-scheme) - 1. [template](#312-template) - 1. [tilejson](#313-tilejson) - 1. [tiles](#314-tiles) - 1. [vector_layers](#315-vector_layers) - 1. [version](#316-version) + 1. [tilejson](#31-tilejson) + 1. [tiles](#32-tiles) + 1. [vector_layers](#33-vector_layers) + 1. [attribution](#34-attribution) + 1. [bounds](#35-bounds) + 1. [center](#36-center) + 1. [data](#37-data) + 1. [description](#38-description) + 1. [fillzoom](#39-fillzoom) + 1. [grids](#310-grids) + 1. [legend](#311-legend) + 1. [maxzoom](#312-maxzoom) + 1. [minzoom](#313-minzoom) + 1. [name](#314-name) + 1. [scheme](#315-scheme) + 1. [template](#316-template) + 1. [version](#317-version) 1. [Examples](#4-examples) # 1. Purpose @@ -38,7 +38,100 @@ TileJSON manifest files use the JSON format as described in [RFC 8259](https://t Implementations MUST treat unknown keys as if they weren't present. However, implementations MUST expose unknown key value pairs so users can optionally handle these keys. Implementations MUST treat invalid values for keys as if they weren’t present. If the the key is optional and the value is invalid, the default value MAY be applied. If the key is required, implementations MUST treat the entire TileJSON manifest file as invalid and refuse operation. -## 3.1 `attribution` +## 3.1 `tilejson` + +REQUIRED. + +A semver.org style version number as a string. Describes the version of the TileJSON spec that is implemented by this JSON object. + +```JSON +{ + "tilejson": "3.0.0" +} +``` + +## 3.2 `tiles` + +REQUIRED. + +An array of tile endpoints. {z}, {x} and {y}, if present, are replaced with the corresponding integers. If multiple endpoints are specified, clients may use any combination of endpoints. All endpoint urls MUST be absolute. All endpoints MUST return the same content for the same URL. The array MUST contain at least one endpoint. The tile extension is NOT limited to any particular format. Some of the more popular are: mvt, vector.pbf, png, webp, and jpg. + +```JSON +{ + "tiles": [ + "http://localhost:8888/admin/1.0.0/world-light,broadband/{z}/{x}/{y}.mvt" + ] +} +``` + +## 3.3 `vector_layers` + +REQUIRED. + +A JSON object whose value is an array of JSON objects. Each of those JSON objects describes one layer of vector tile data. A `vector_layer` object MUST contain the `id` and `fields` keys, and MAY contain the `description`, `minzoom`, or `maxzoom` keys. + +#### 3.3.1 `id` + +REQUIRED. + +A string value representing the the layer id. For added context, this is referred to as the `name` of the layer in the [Mapbox Vector Tile spec](https://github.com/mapbox/vector-tile-spec/tree/master/2.1#41-layers). + +#### 3.3.2 `fields` + +REQUIRED. + +A JSON object whose keys and values are the names and descriptions of attributes available in this layer. Each value (description) MUST be a string that describes the underlying data. If no fields are present, the `fields` key MUST be an empty object. + +#### 3.3.3 `description` + +OPTIONAL. + +A string representing a human-readable description of the entire layer's contents. + +#### 3.3.4 `minzoom` and `maxzoom` + +OPTIONAL. + +A number representing the lowest/highest zoom level whose tiles this layer appears in. `minzoom` MUST be greater than or equal to the set of tiles' `minzoom`. `maxzoom` MUST be less than or equal to the set of tiles' `maxzoom`. + +These keys are used to describe the situation where different sets of vector layers appear in different zoom levels of the same set of tiles, for example in a case where a "minor roads" layer is only present at high zoom levels. + +```JSON +{ + "vector_layers": [ + { + "id": "roads", + "description": "Roads and their attributes", + "minzoom": 2, + "maxzoom": 16, + "fields": { + "type": "One of: trunk, primary, secondary", + "lanes": "Number", + "name": "String", + "sidewalks": "Boolean" + } + }, + { + "id": "countries", + "description": "Admin 0 (country) boundaries", + "minzoom": 0, + "maxzoom": 16, + "fields": { + "iso": "ISO 3166-1 Alpha-2 code", + "name": "English name of the country", + "name_ar": "Arabic name of the country" + } + }, + { + "id": "buildings", + "description": "A layer with an empty fields object", + "fields": {} + } + ] +} +``` + +## 3.4 `attribution` OPTIONAL. Default: null. @@ -50,7 +143,7 @@ Contains an attribution to be displayed when the map is shown to a user. Impleme } ``` -## 3.2 `bounds` +## 3.5 `bounds` OPTIONAL. Default: [ -180, -85.05112877980659, 180, 85.0511287798066 ] (xyz-compliant tile bounds) @@ -62,7 +155,7 @@ The maximum extent of available map tiles. Bounds MUST define an area covered by } ``` -## 3.3 `center` +## 3.6 `center` OPTIONAL. Default: null. @@ -74,7 +167,7 @@ The first value is the longitude, the second is latitude (both in WGS:84 values) } ``` -## 3.4 `data` +## 3.7 `data` OPTIONAL. Default: []. @@ -88,7 +181,7 @@ An array of data files in GeoJSON format. {z}, {x} and {y}, if present, are repl } ``` -## 3.5 `description` +## 3.8 `description` OPTIONAL. Default: null. @@ -100,7 +193,7 @@ A text description of the set of tiles. The description can contain any valid un } ``` -## 3.6 `fillzoom` +## 3.9 `fillzoom` OPTIONAL. Default: null. @@ -114,7 +207,7 @@ For example, in a set of tiles with maxzoom 10 and _no_ fillzoom specified, if a } ``` -## 3.6 `grids` +## 3.10 `grids` OPTIONAL. Default: []. @@ -130,7 +223,7 @@ An array of interactivity endpoints. {z}, {x} and {y}, if present, are replaced } ``` -## 3.7 `legend` +## 3.11 `legend` OPTIONAL. Default: null. @@ -142,7 +235,7 @@ Contains a legend to be displayed with the map. Implementations MAY decide to tr } ``` -## 3.8 `maxzoom` +## 3.12 `maxzoom` OPTIONAL. Default: 30. >= 0, <= 30. @@ -154,7 +247,7 @@ An integer specifying the maximum zoom level. MUST be >= minzoom. } ``` -## 3.9 `minzoom` +## 3.13 `minzoom` OPTIONAL. Default: 0. >= 0, <= 30. @@ -166,7 +259,7 @@ An integer specifying the minimum zoom level. MUST be <= maxzoom } ``` -## 3.10 `name` +## 3.14 `name` OPTIONAL. Default: null. @@ -178,7 +271,7 @@ A name describing the set of tiles. The name can contain any legal character. Im } ``` -## 3.11 `scheme` +## 3.15 `scheme` OPTIONAL. Default: "xyz". @@ -190,7 +283,7 @@ Either "xyz" or "tms". Influences the y direction of the tile coordinates. The g } ``` -## 3.12 `template` +## 3.16 `template` OPTIONAL. Default: null. @@ -202,101 +295,7 @@ Contains a mustache template to be used to format data from grids for interactio } ``` -## 3.13 `tilejson` - -REQUIRED. - -A semver.org style version number as a string. Describes the version of the TileJSON spec that is implemented by this JSON object. - -```JSON -{ - "tilejson": "3.0.0" -} -``` - -## 3.14 `tiles` - -REQUIRED. - -An array of tile endpoints. {z}, {x} and {y}, if present, are replaced with the corresponding integers. If multiple endpoints are specified, clients may use any combination of endpoints. All endpoint urls MUST be absolute. All endpoints MUST return the same content for the same URL. The array MUST contain at least one endpoint. The tile extension is NOT limited to any particular format. Some of the more popular are: mvt, vector.pbf, png, webp, and jpg. - -```JSON -{ - "tiles": [ - "http://localhost:8888/admin/1.0.0/world-light,broadband/{z}/{x}/{y}.mvt" - ] -} -``` - -## 3.15 `vector_layers` - -REQUIRED. - -A JSON object whose value is an array of JSON objects. Each of those JSON objects describes one layer of vector tile data. A `vector_layer` object MUST contain the `id` and `fields` keys, and MAY contain the `description`, `minzoom`, or `maxzoom` keys. - -#### 3.15.1 `id` - -REQUIRED. - -A string value representing the the layer id. For added context, this is referred to as the `name` of the layer in the [Mapbox Vector Tile spec](https://github.com/mapbox/vector-tile-spec/tree/master/2.1#41-layers). - -#### 3.15.2 `fields` - -REQUIRED. - -A JSON object whose keys and values are the names and descriptions of attributes available in this layer. Each value (description) MUST be a string that describes the underlying data. If no fields are present, the `fields` key MUST be an empty object. - -#### 3.15.3 `description` - -OPTIONAL. - -A string representing a human-readable description of the entire layer's contents. - -#### 3.15.4 `minzoom` and `maxzoom` - -OPTIONAL. - -A number representing the lowest/highest zoom level whose tiles this layer appears in. `minzoom` MUST be greater than or equal to the set of tiles' `minzoom`. `maxzoom` MUST be less than or equal to the set of tiles' `maxzoom`. - -These keys are used to describe the situation where different sets of vector layers appear in different zoom levels of the same set of tiles, for example in a case where a "minor roads" layer is only present at high zoom levels. - -```JSON -{ - "vector_layers": [ - { - "id": "roads", - "description": "Roads and their attributes", - "minzoom": 2, - "maxzoom": 16, - "fields": { - "type": "One of: trunk, primary, secondary", - "lanes": "Number", - "name": "String", - "sidewalks": "Boolean" - } - }, - { - "id": "countries", - "description": "Admin 0 (country) boundaries", - "minzoom": 0, - "maxzoom": 16, - "fields": { - "iso": "ISO 3166-1 Alpha-2 code", - "name": "English name of the country", - "name_ar": "Arabic name of the country" - } - }, - { - "id": "buildings", - "description": "A layer with an empty fields object", - "fields": {} - } - ] -} -``` - - -## 3.16 `version` +## 3.17 `version` OPTIONAL. Default: "1.0.0". From 2efe6ab16c457613f03e39eda619b7da7bbafc00 Mon Sep 17 00:00:00 2001 From: mapsam Date: Thu, 2 Aug 2018 14:51:35 -0700 Subject: [PATCH 08/13] add extra note about bounds of one dimension --- 3.0.0/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/3.0.0/README.md b/3.0.0/README.md index 6340e9f..de12bdb 100644 --- a/3.0.0/README.md +++ b/3.0.0/README.md @@ -155,6 +155,14 @@ The maximum extent of available map tiles. Bounds MUST define an area covered by } ``` +Bounds where longitude east & west, and latitude east & west are the same are considered valid. This case typically represents a single point geometry in the entire tileset. For example: + +```JSON +{ + "bounds": [-122.34, 47.65, -122.34, 47.65] +} +``` + ## 3.6 `center` OPTIONAL. Default: null. From d5bbecf3e5d547270f9ada21b34a7cfc74ad8dce Mon Sep 17 00:00:00 2001 From: mapsam Date: Wed, 8 Aug 2018 11:52:13 -0700 Subject: [PATCH 09/13] define implementation --- 3.0.0/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/3.0.0/README.md b/3.0.0/README.md index de12bdb..70cdcde 100644 --- a/3.0.0/README.md +++ b/3.0.0/README.md @@ -36,7 +36,9 @@ TileJSON manifest files use the JSON format as described in [RFC 8259](https://t # 3. Structure -Implementations MUST treat unknown keys as if they weren't present. However, implementations MUST expose unknown key value pairs so users can optionally handle these keys. Implementations MUST treat invalid values for keys as if they weren’t present. If the the key is optional and the value is invalid, the default value MAY be applied. If the key is required, implementations MUST treat the entire TileJSON manifest file as invalid and refuse operation. +The following describes the structure of a TileJSON object. Implementations MUST treat unknown keys as if they weren't present. However, implementations MUST expose unknown key value pairs so users can optionally handle these keys. Implementations MUST treat invalid values for keys as if they weren’t present. If the the key is optional and the value is invalid, the default value MAY be applied. If the key is required, implementations MUST treat the entire TileJSON manifest file as invalid and refuse operation. + +*The word "implementation" in the following sections refers to services or tools that serve, generate, or validate TileJSON objects.* ## 3.1 `tilejson` From 8b7cedd7dd343f8bc01a41579627b534a647d557 Mon Sep 17 00:00:00 2001 From: mapsam Date: Wed, 8 Aug 2018 12:26:18 -0700 Subject: [PATCH 10/13] add caching, schema.json --- 3.0.0/README.md | 5 +++ 3.0.0/schema.json | 106 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 110 insertions(+), 1 deletion(-) diff --git a/3.0.0/README.md b/3.0.0/README.md index 70cdcde..6795e0c 100644 --- a/3.0.0/README.md +++ b/3.0.0/README.md @@ -25,6 +25,7 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "S 1. [template](#316-template) 1. [version](#317-version) 1. [Examples](#4-examples) +1. [Caching](#5-caching) # 1. Purpose @@ -320,3 +321,7 @@ A [semver.org](https://semver.org) style version number of the tiles. When chang # 4. Examples Examples can be found in the example/ directory. + +# 5. Caching + +Clients MAY cache files retrieved from a remote server. When implementations decide to perform caching, they MUST honor valid cache control HTTP headers as defined in the HTTP specification for both tile images and the TileJSON manifest file. diff --git a/3.0.0/schema.json b/3.0.0/schema.json index 1c12cf9..507a77c 100644 --- a/3.0.0/schema.json +++ b/3.0.0/schema.json @@ -1 +1,105 @@ -schema +{ + "name": "TileJSON", + "type": "object", + "properties": { + "tilejson": { + "type": "string", + "pattern": "\\d+\\.\\d+\\.\\d+\\w?[\\w\\d]*" + }, + "tiles": { + "type": "array", + "items": { + "type": "string" + } + }, + "vector_layers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "fields": { + "type": "object", + "additionalProperties": { "type": "string" } + }, + "description": { + "type": "string" + }, + "maxzoom": { + "type": "integer" + }, + "minzoom": { + "type": "integer" + } + }, + "required": [ "id", "fields" ], + "additionalProperties": true + } + }, + "attribution": { + "type": "string" + }, + "bounds": { + "type": "array", + "items": { + "type": "number" + } + }, + "center": { + "type": "array", + "items": { + "type": "number" + } + }, + "data": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "type": "string" + }, + "fillzoom": { + "minimum": 0, + "maximum": 30, + "type": "integer" + }, + "grids": { + "type": "array", + "items": { + "type": "string" + } + }, + "legend": { + "type": "string" + }, + "maxzoom": { + "minimum": 0, + "maximum": 30, + "type": "integer" + }, + "minzoom": { + "minimum": 0, + "maximum": 30, + "type": "integer" + }, + "name": { + "type": "string" + }, + "scheme": { + "type": "string" + }, + "template": { + "type": "string" + }, + "version": { + "type": "string", + "pattern": "\\d+\\.\\d+\\.\\d+\\w?[\\w\\d]*" + } + }, + "required": ["tilejson", "tiles", "vector_layers"], + "additionalProperties": true +} From 9c905d7b5887bc9fb562595a6aa3de8d86a98339 Mon Sep 17 00:00:00 2001 From: mapsam Date: Wed, 8 Aug 2018 12:44:15 -0700 Subject: [PATCH 11/13] add osm.json example --- 3.0.0/example/osm.json | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 3.0.0/example/osm.json diff --git a/3.0.0/example/osm.json b/3.0.0/example/osm.json new file mode 100644 index 0000000..477ce39 --- /dev/null +++ b/3.0.0/example/osm.json @@ -0,0 +1,42 @@ +{ + "tilejson": "3.0.0", + "name": "OpenStreetMap", + "description": "A free editable map of the whole world.", + "version": "1.0.0", + "attribution": "(c) OpenStreetMap contributors, CC-BY-SA", + "scheme": "xyz", + "tiles": [ + "https://a.tile.custom-osm-tiles.org/{z}/{x}/{y}.mvt", + "https://b.tile.custom-osm-tiles.org/{z}/{x}/{y}.mvt", + "https://c.tile.custom-osm-tiles.org/{z}/{x}/{y}.mvt" + ], + "minzoom": 0, + "maxzoom": 18, + "bounds": [ -180, -85, 180, 85 ], + "fillzoom": 6, + "something_custom": "this is my unique field", + "vector_layers": [ + { + "id": "telephone", + "fields": { + "phone_number": "the phone number", + "payment": "how to pay" + } + }, + { + "id": "bicycle_parking", + "fields": { + "type": "the type of bike parking", + "year_installed": "the year the bike parking was installed" + } + }, + { + "id": "showers", + "fields": { + "water_temperature": "the maximum water temperature", + "wear_sandles": "whether you should wear sandles or not", + "wheelchair": "is the shower wheelchair friendly?" + } + } + ] +} From f46196a4b59d7f42ebf77d2e31d9b82e97925176 Mon Sep 17 00:00:00 2001 From: mapsam Date: Wed, 8 Aug 2018 12:45:22 -0700 Subject: [PATCH 12/13] add examples link --- 3.0.0/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3.0.0/README.md b/3.0.0/README.md index 6795e0c..07364eb 100644 --- a/3.0.0/README.md +++ b/3.0.0/README.md @@ -320,7 +320,7 @@ A [semver.org](https://semver.org) style version number of the tiles. When chang # 4. Examples -Examples can be found in the example/ directory. +Examples can be found in the [example directory](/examples). # 5. Caching From f12210989b5b02f6e08ee0799dd993aed8442faa Mon Sep 17 00:00:00 2001 From: mapsam Date: Wed, 8 Aug 2018 12:46:17 -0700 Subject: [PATCH 13/13] fix link --- 3.0.0/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3.0.0/README.md b/3.0.0/README.md index 07364eb..d2aa56f 100644 --- a/3.0.0/README.md +++ b/3.0.0/README.md @@ -320,7 +320,7 @@ A [semver.org](https://semver.org) style version number of the tiles. When chang # 4. Examples -Examples can be found in the [example directory](/examples). +Examples can be found in the [examples directory](/example). # 5. Caching