Struct tilejson::tilejson::TileJSON[][src]

pub struct TileJSON {
Show 16 fields pub tilejson: &'static str, pub id: Option<String>, pub name: Option<String>, pub description: Option<String>, pub version: Option<String>, pub attribution: Option<String>, pub template: Option<String>, pub legend: Option<String>, pub scheme: Option<String>, pub tiles: Vec<String>, pub grids: Option<Vec<String>>, pub data: Option<Vec<String>>, pub minzoom: Option<u8>, pub maxzoom: Option<u8>, pub bounds: Option<Vec<f32>>, pub center: Option<Vec<i32>>,
}
Expand description

TileJSON struct that represents map metadata

Fields

tilejson: &'static str

A semver.org style version number. Describes the version of the TileJSON spec that is implemented by this JSON object.

id: Option<String>

The tileset id.

name: Option<String>

A name describing the tileset. The name can contain any legal character. Implementations SHOULD NOT interpret the name as HTML.

description: Option<String>

A text description of the tileset. The description can contain any legal character. Implementations SHOULD NOT interpret the description as HTML.

version: Option<String>

A semver.org style version number. When changes across tiles are introduced, the minor version MUST change. This may lead to cut off labels. Therefore, implementors can decide to clean their cache when the minor version changes. Changes to the patch level MUST only have changes to tiles that are contained within one tile. When tiles change significantly, the major version MUST be increased. Implementations MUST NOT use tiles with different major versions.

attribution: Option<String>

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.

template: Option<String>

Contains a mustache template to be used to format data from grids for interaction. See https://github.com/mapbox/utfgrid-spec/tree/master/1.2 for the interactivity specification.

legend: Option<String>

Contains a legend to be displayed with the map. 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.

scheme: Option<String>

Either “xyz” or “tms”. Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed.

tiles: Vec<String>

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.

grids: Option<Vec<String>>

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, interactivity is not supported for this tileset. See https://github.com/mapbox/utfgrid-spec/tree/master/1.2 for the interactivity specification.

data: Option<Vec<String>>

An array of data files in GeoJSON format. {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, then no data is present in the map.

minzoom: Option<u8>

An integer specifying the minimum zoom level.

maxzoom: Option<u8>

An integer specifying the maximum zoom level. MUST be >= minzoom.

bounds: Option<Vec<f32>>

The maximum extent of available map tiles. Bounds MUST define an area covered by all zoom levels. The bounds are represented in WGS:84 latitude and longitude values, in the order left, bottom, right, top. Values may be integers or floating point numbers.

center: Option<Vec<i32>>

The first value is the longitude, the second is latitude (both in WGS:84 values), the third value is the zoom level as an integer. Longitude and latitude MUST be within the specified bounds. The zoom level MUST be between minzoom and maxzoom. Implementations can use this value to set the default location. If the value is null, implementations may use their own algorithm for determining a default location.

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.