pub struct ProjectionBuilder { /* private fields */ }
Expand description

Builder for Projection.

Implementations§

source§

impl ProjectionBuilder

source

pub fn center<VALUE: Into<Vec<f64>>>(&mut self, value: VALUE) -> &mut Self

The projection’s center, a two-element array of longitude and latitude in degrees.

Default value: [0, 0]

source

pub fn clip_angle<VALUE: Into<RemovableValue<f64>>>( &mut self, value: VALUE ) -> &mut Self

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

source

pub fn clip_extent<VALUE: Into<RemovableValue<Vec<Vec<f64>>>>>( &mut self, value: VALUE ) -> &mut Self

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.

source

pub fn coefficient<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self

source

pub fn distance<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self

source

pub fn extent<VALUE: Into<Vec<Vec<f64>>>>(&mut self, value: VALUE) -> &mut Self

source

pub fn fit<VALUE: Into<Value>>(&mut self, value: VALUE) -> &mut Self

source

pub fn fraction<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self

source

pub fn lobes<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self

source

pub fn parallel<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self

source

pub fn parallels<VALUE: Into<Vec<f64>>>(&mut self, value: VALUE) -> &mut Self

For conic projections, the two standard parallels that define the map layout. The default depends on the specific conic projection used.

source

pub fn point_radius<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self

The default radius (in pixels) to use when drawing GeoJSON Point and MultiPoint geometries. This parameter sets a constant default value. To modify the point radius in response to data, see the corresponding parameter of the GeoPath and GeoShape transforms.

Default value: 4.5

source

pub fn precision<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self

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….

source

pub fn radius<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self

source

pub fn ratio<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self

source

pub fn reflect_x<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self

source

pub fn reflect_y<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self

source

pub fn rotate<VALUE: Into<Vec<f64>>>(&mut self, value: VALUE) -> &mut Self

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]

source

pub fn scale<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self

The projection’s scale (zoom) factor, overriding automatic fitting. The default scale is projection-specific. The scale factor corresponds linearly to the distance between projected points; however, scale factor values are not equivalent across projections.

source

pub fn size<VALUE: Into<Vec<f64>>>(&mut self, value: VALUE) -> &mut Self

source

pub fn spacing<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self

source

pub fn tilt<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self

source

pub fn translate<VALUE: Into<Vec<f64>>>(&mut self, value: VALUE) -> &mut Self

The projection’s translation offset as a two-element array [tx, ty].

source

pub fn projection_type<VALUE: Into<ProjectionType>>( &mut self, value: VALUE ) -> &mut Self

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

source

pub fn build(&self) -> Result<Projection, ProjectionBuilderError>

Builds a new Projection.

Errors

If a required field has not been initialized.

Trait Implementations§

source§

impl Clone for ProjectionBuilder

source§

fn clone(&self) -> ProjectionBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for ProjectionBuilder

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.