Struct tilejson::VectorLayer
source · pub struct VectorLayer {
pub id: String,
pub fields: BTreeMap<String, String>,
pub description: Option<String>,
pub maxzoom: Option<u8>,
pub minzoom: Option<u8>,
pub other: BTreeMap<String, Value>,
}
Expand description
Each object 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. An implementation MAY include arbitrary keys in the object
outside of those defined in this specification.
Note: When describing a set of raster tiles or other tile format that does not have
a “layers” concept (i.e. “format”: “jpeg”), the vector_layers
key is not required.
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.
{
"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": {}
}
]
}
See https://github.com/mapbox/tilejson-spec/tree/master/3.0.0#33-vector_layers
Fields§
§id: String
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. See https://github.com/mapbox/tilejson-spec/tree/master/3.0.0#331-id
fields: BTreeMap<String, String>
An 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. https://github.com/mapbox/tilejson-spec/tree/master/3.0.0#332-fields
description: Option<String>
A string representing a human-readable description of the entire layer’s contents.
See https://github.com/mapbox/tilejson-spec/tree/master/3.0.0#333-description
maxzoom: Option<u8>
An integer representing the highest zoom level whose tiles this layer appears in.
maxzoom MUST be less than or equal to the set of tiles’ maxzoom. See https://github.com/mapbox/tilejson-spec/tree/master/3.0.0#334-minzoom-and-maxzoom
minzoom: Option<u8>
An integer representing the lowest zoom level whose tiles this layer appears in.
minzoom MUST be greater than or equal to the set of tiles’ minzoom. See https://github.com/mapbox/tilejson-spec/tree/master/3.0.0#334-minzoom-and-maxzoom
other: BTreeMap<String, Value>
Any unrecognized fields will be stored here.
Implementations§
Trait Implementations§
source§impl Clone for VectorLayer
impl Clone for VectorLayer
source§fn clone(&self) -> VectorLayer
fn clone(&self) -> VectorLayer
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for VectorLayer
impl Debug for VectorLayer
source§impl<'de> Deserialize<'de> for VectorLayer
impl<'de> Deserialize<'de> for VectorLayer
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for VectorLayer
impl PartialEq for VectorLayer
source§fn eq(&self, other: &VectorLayer) -> bool
fn eq(&self, other: &VectorLayer) -> bool
self
and other
values to be equal, and is used
by ==
.