Struct galileo::MapBuilder

source ·
pub struct MapBuilder { /* private fields */ }
Expand description

Builder for a GalileoMap.

Implementations§

source§

impl MapBuilder

source

pub fn new() -> Self

Creates a new instance.

source

pub fn create_raster_tile_layer( tile_source: impl UrlSource<TileIndex> + 'static, tile_scheme: TileSchema ) -> RasterTileLayer<UrlImageProvider<TileIndex, FileCacheController>>

Create a new raster tile layer.

source

pub fn with_raster_tiles( self, tile_source: impl UrlSource<TileIndex> + 'static, tile_scheme: TileSchema ) -> Self

Add a new raster layer to the layer list.

source

pub fn create_vector_tile_layer( tile_source: impl UrlSource<TileIndex> + 'static, tile_scheme: TileSchema, style: VectorTileStyle ) -> VectorTileLayer<ThreadedProvider<UrlDataProvider<TileIndex, VtProcessor, FileCacheController>>>

Create a new vector tile layer.

source§

impl MapBuilder

source

pub async fn build(self) -> GalileoMap

Consturct GalileoMap.

source

pub fn with_window(self, window: Window) -> Self

Use the given window instead of creating a default one.

source

pub fn with_event_loop(self, event_loop: EventLoop<()>) -> Self

Use the given event loop instead of creating a default one.

source

pub fn center(self, position: GeoPoint2d) -> Self

Set the center of the map.

source

pub fn resolution(self, resolution: f64) -> Self

Set the resolution of the map. For explanation about resolution, see MapView::resolution.

source

pub fn with_view(self, view: MapView) -> Self

Set the view of the map.

source

pub fn with_vector_tiles( self, tile_source: impl UrlSource<TileIndex> + 'static, tile_scheme: TileSchema, style: VectorTileStyle ) -> Self

Add a vector tile layer with the given parameters.

source

pub fn with_layer(self, layer: impl Layer + 'static) -> Self

Add a give layer to the map.

source

pub fn with_event_handler( self, handler: impl Fn(&UserEvent, &mut Map) -> EventPropagation + MaybeSend + MaybeSync + 'static ) -> Self

Add an event handler.

Trait Implementations§

source§

impl Default for MapBuilder

source§

fn default() -> Self

Returns the “default value” for a type. 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
§

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

§

fn crs_id(&self) -> Option<MdIdentifier>

§

fn crs(&self) -> Option<Crs>

§

fn coordinate_epoch(&self) -> Option<DataEpoch>

§

fn is_valid(&self) -> bool

§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more