Skip to main content

ProjectionConfig

Struct ProjectionConfig 

Source
pub struct ProjectionConfig {
Show 15 fields pub center: Option<Vec<f64>>, pub clip_angle: Option<f64>, pub clip_extent: Option<Vec<Vec<f64>>>, pub coefficient: Option<f64>, pub distance: Option<f64>, pub fraction: Option<f64>, pub lobes: Option<f64>, pub parallel: Option<f64>, pub precision: Option<HashMap<String, PrecisionValue>>, pub radius: Option<f64>, pub ratio: Option<f64>, pub rotate: Option<Vec<f64>>, pub spacing: Option<f64>, pub tilt: Option<f64>, pub projection_config_type: Option<VgProjectionType>,
}
Expand description

Projection configuration, which determines default properties for all projections. For a full list of projection configuration options, please see the corresponding section of the projection documentation.

Any property of Projection can be in config

Fields§

§center: Option<Vec<f64>>

Sets the projection’s center to the specified center, a two-element array of longitude and latitude in degrees.

Default value: [0, 0]

§clip_angle: Option<f64>

Sets the projection’s clipping circle radius to the specified angle in degrees. If null, switches to antimeridian cutting rather than small-circle clipping.

§clip_extent: Option<Vec<Vec<f64>>>

Sets the projection’s viewport clip extent to the specified bounds in pixels. The extent bounds are specified as an array [[x0, y0], [x1, y1]], where x0 is the left-side of the viewport, y0 is the top, x1 is the right and y1 is the bottom. If null, no viewport clipping is performed.

§coefficient: Option<f64>§distance: Option<f64>§fraction: Option<f64>§lobes: Option<f64>§parallel: Option<f64>§precision: Option<HashMap<String, PrecisionValue>>

Sets the threshold for the projection’s adaptive resampling to the specified value in pixels. This value corresponds to the Douglas–Peucker distance. If precision is not specified, returns the projection’s current resampling precision which defaults to √0.5 ≅ 0.70710….

§radius: Option<f64>§ratio: Option<f64>§rotate: Option<Vec<f64>>

Sets the projection’s three-axis rotation to the specified angles, which must be a two- or three-element array of numbers [lambda, phi, gamma] specifying the rotation angles in degrees about each spherical axis. (These correspond to yaw, pitch and roll.)

Default value: [0, 0, 0]

§spacing: Option<f64>§tilt: Option<f64>§projection_config_type: Option<VgProjectionType>

The cartographic projection to use. This value is case-insensitive, for example "albers" and "Albers" indicate the same projection type. You can find all valid projection types in the documentation.

Default value: mercator

Trait Implementations§

Source§

impl Debug for ProjectionConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ProjectionConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ProjectionConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,