pub struct LayerJson {
pub tilejson: String,
pub format: String,
pub version: String,
pub scheme: String,
pub tiles: Vec<String>,
pub available: Vec<Vec<TileAvailability>>,
pub attribution: Option<String>,
pub min_zoom: Option<u8>,
pub max_zoom: Option<u8>,
pub bounds: Option<[f64; 4]>,
pub extensions: Vec<String>,
pub metadata_availability: Option<u8>,
}Expand description
Serializable Cesium layer.json structure.
Build via LayerJson::from_config or construct directly. Serialize
with serde_json to produce the file Cesium expects.
Fields§
§tilejson: StringTileJSON version (Cesium expects "2.1.0").
format: StringTerrain format identifier (e.g. "quantized-mesh-1.0").
version: StringData version, used by Cesium for cache busting.
scheme: StringTiling scheme ("tms" or "xyz").
tiles: Vec<String>Tile URL templates (Cesium picks the first one).
available: Vec<Vec<TileAvailability>>Per-zoom-level tile availability.
attribution: Option<String>Attribution text.
min_zoom: Option<u8>Minimum zoom level.
max_zoom: Option<u8>Maximum zoom level.
bounds: Option<[f64; 4]>Geographic bounds [west, south, east, north].
extensions: Vec<String>Enabled extensions.
metadata_availability: Option<u8>Metadata-availability zoom depth for the metadata extension.
Implementations§
Source§impl LayerJson
impl LayerJson
Sourcepub fn from_config(config: &LayerJsonConfig) -> Self
pub fn from_config(config: &LayerJsonConfig) -> Self
Build from a LayerJsonConfig.
Sourcepub fn to_json_pretty(&self) -> Result<String>
pub fn to_json_pretty(&self) -> Result<String>
Convenience: serialize to a pretty-printed JSON string.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LayerJson
impl<'de> Deserialize<'de> for LayerJson
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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for LayerJson
Auto Trait Implementations§
impl Freeze for LayerJson
impl RefUnwindSafe for LayerJson
impl Send for LayerJson
impl Sync for LayerJson
impl Unpin for LayerJson
impl UnsafeUnpin for LayerJson
impl UnwindSafe for LayerJson
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more