pub struct Metadata {Show 28 fields
pub s2tilejson: String,
pub version: String,
pub name: String,
pub scheme: Scheme,
pub description: String,
pub type: SourceType,
pub extension: String,
pub encoding: Encoding,
pub faces: Vec<Face>,
pub bounds: LonLatBounds,
pub wmbounds: WMBounds,
pub s2bounds: FaceBounds,
pub minzoom: u8,
pub maxzoom: u8,
pub centerpoint: Center,
pub attributions: Attributions,
pub layers: LayersMetaData,
pub tilestats: TileStatsMetadata,
pub vector_layers: Vec<VectorLayer>,
pub tilejson: Option<String>,
pub tiles: Option<Vec<String>>,
pub attribution: Option<String>,
pub fillzoom: Option<u8>,
pub center: Option<[f64; 3]>,
pub data: Option<Vec<String>>,
pub grids: Option<Vec<String>>,
pub legend: Option<String>,
pub template: Option<String>,
}Expand description
§S2 TileJSON V1.0.0
let meta: Metadata =
serde_json::from_str(meta_str).unwrap_or_else(|e| panic!("ERROR: {e}"));Represents a TileJSON metadata object for the new S2 spec.
If you’re unsure of which spec you’re using, use the UnknownMetadata type.
§Links
Fields§
§s2tilejson: StringThe version of the s2-tilejson spec. Matches the pattern: ^\d+\.\d+\.\d+\w?[\w\d]*$.
version: StringThe version of the data. Matches the pattern: ^\d+\.\d+\.\d+\w?[\w\d]*$.
name: StringThe name of the data
scheme: SchemeThe scheme of the data
description: StringThe description of the data
type: SourceTypeThe type of the data
extension: StringThe extension to use when requesting a tile
encoding: EncodingThe encoding of the data
faces: Vec<Face>List of faces that have data
bounds: LonLatBoundsBounding box array [west, south, east, north].
wmbounds: WMBoundsWM Tile fetching bounds. Helpful to not make unecessary requests for tiles we know don’t exist
s2bounds: FaceBoundsS2 Tile fetching bounds. Helpful to not make unecessary requests for tiles we know don’t exist
minzoom: u8minzoom at which to request tiles. [default=0]
maxzoom: u8maxzoom at which to request tiles. [default=27]
centerpoint: CenterThe center of the data
attributions: Attributions{ [‘human readable string’]: ‘href’ }
layers: LayersMetaDataTrack layer metadata
tilestats: TileStatsMetadataTrack tile stats for each face and total overall
vector_layers: Vec<VectorLayer>Old spec but required for functional compatibility, track basic layer metadata
tilejson: Option<String>Version of the TileJSON spec used. Matches the pattern: ^\d+\.\d+\.\d+\w?[\w\d]*$.
tiles: Option<Vec<String>>Array of tile URL templates.
attribution: Option<String>Attribution string.
fillzoom: Option<u8>Fill zoom level. Must be between 0 and 30.
center: Option<[f64; 3]>Center coordinate array [longitude, latitude, zoom].
data: Option<Vec<String>>Array of data source URLs.
grids: Option<Vec<String>>Array of UTFGrid URL templates.
legend: Option<String>Legend of the tileset.
template: Option<String>Template for interactivity.