pub struct WorldMapProps {Show 21 fields
pub label: String,
pub countries: Vec<WorldMapCountry>,
pub highlighted_countries: Vec<String>,
pub markers: Vec<WorldMapMarker>,
pub labels: Vec<(String, String)>,
pub variant: WorldMapVariant,
pub interactive: bool,
pub zoomable: bool,
pub initial_view: Option<WorldMapInitialView>,
pub animated: bool,
pub selected_country: Option<String>,
pub default_selected_country: Option<String>,
pub on_selected_country_change: Option<EventHandler<String>>,
pub on_country_select: Option<EventHandler<WorldMapSelectDetail>>,
pub heading: Option<String>,
pub description: Option<String>,
pub caption: Option<String>,
pub list_label: String,
pub zoom_labels: WorldMapZoomLabels,
pub class: Option<String>,
pub attributes: Vec<Attribute>,
}Expand description
Props for WorldMap.
Fields§
§label: StringAccessible name of the map image.
countries: Vec<WorldMapCountry>Country geometry, usually world_map_countries().to_vec(). Invalid and duplicate
entries are dropped.
highlighted_countries: Vec<String>Highlighted country ids (case-insensitive). Unknown ids are ignored.
markers: Vec<WorldMapMarker>Location markers. Invalid markers are dropped.
labels: Vec<(String, String)>Country label overrides as (id, label) pairs.
variant: WorldMapVariantDotted (default) or solid land.
interactive: boolLets users select countries by clicking or with the country list.
zoomable: boolShows the zoom controls and lets users zoom and pan.
initial_view: Option<WorldMapInitialView>The first view once the map is mounted.
animated: boolPlays the entrance and marker animations (reduced motion turns them off).
selected_country: Option<String>Controlled selected country id.
default_selected_country: Option<String>Initially selected country id when uncontrolled.
on_selected_country_change: Option<EventHandler<String>>Called with the selected country id, or an empty string when the selection clears.
on_country_select: Option<EventHandler<WorldMapSelectDetail>>Called with details of a newly selected country.
heading: Option<String>Heading above the map.
description: Option<String>Description under the heading.
caption: Option<String>Caption under the map.
list_label: StringLabel and placeholder of the country list. Defaults to Choose a country.
zoom_labels: WorldMapZoomLabelsCopy for the zoom controls.
class: Option<String>Extra classes appended after the Lumen class.
attributes: Vec<Attribute>Any other <figure> or global attribute.
Implementations§
Source§impl WorldMapProps
impl WorldMapProps
Sourcepub fn builder() -> WorldMapPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> WorldMapPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building WorldMapProps.
On the builder, call .label(...), .countries(...), .highlighted_countries(...)(optional), .markers(...)(optional), .labels(...)(optional), .variant(...)(optional), .interactive(...)(optional), .zoomable(...)(optional), .initial_view(...)(optional), .animated(...)(optional), .selected_country(...)(optional), .default_selected_country(...)(optional), .on_selected_country_change(...)(optional), .on_country_select(...)(optional), .heading(...)(optional), .description(...)(optional), .caption(...)(optional), .list_label(...)(optional), .zoom_labels(...)(optional), .class(...)(optional), .attributes(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of WorldMapProps.
Trait Implementations§
Source§impl Clone for WorldMapProps
impl Clone for WorldMapProps
Source§impl PartialEq for WorldMapProps
impl PartialEq for WorldMapProps
Source§impl Properties for WorldMapPropswhere
Self: Clone,
impl Properties for WorldMapPropswhere
Self: Clone,
Source§type Builder = WorldMapPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
type Builder = WorldMapPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Source§fn memoize(&mut self, new: &Self) -> bool
fn memoize(&mut self, new: &Self) -> bool
Source§fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
) -> VComponentwhere
M: 'static,
fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
) -> VComponentwhere
M: 'static,
impl StructuralPartialEq for WorldMapProps
Auto Trait Implementations§
impl !RefUnwindSafe for WorldMapProps
impl !Send for WorldMapProps
impl !Sync for WorldMapProps
impl !UnwindSafe for WorldMapProps
impl Forget for WorldMapProps
impl Freeze for WorldMapPropswhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<WorldMapCountry>: Freeze,
PhantomData<String>: Freeze,
PhantomData<WorldMapMarker>: Freeze,
PhantomData<(String, String)>: Freeze,
&'static UnsyncStorage: Freeze,
NonZero<u64>: Freeze,
&'static Location<'static>: Freeze,
PhantomData<Option<ExternalListenerCallback<String, ()>>>: Freeze,
PhantomData<Option<ExternalListenerCallback<WorldMapSelectDetail, ()>>>: Freeze,
PhantomData<Attribute>: Freeze,
impl Move for WorldMapProps
impl Unpin for WorldMapPropswhere
*const u8 is !null: Unpin,
&'static str: Unpin,
String: Unpin,
&'static UnsyncStorage: Unpin,
NonZero<u64>: Unpin,
&'static Location<'static>: Unpin,
Box<dyn FnMut(String)>: Unpin,
*const RcInner<Runtime> is !null: Unpin,
Box<dyn FnMut(WorldMapSelectDetail)>: Unpin,
Rc<RefCell<dyn FnMut(Event<dyn Any>)>>: Unpin,
Rc<dyn AnyValue>: Unpin,
impl UnsafeUnpin for WorldMapPropswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<WorldMapCountry>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<WorldMapMarker>: UnsafeUnpin,
PhantomData<(String, String)>: UnsafeUnpin,
&'static UnsyncStorage: UnsafeUnpin,
NonZeroU64Inner: UnsafeUnpin,
&'static Location<'static>: UnsafeUnpin,
PhantomData<Option<ExternalListenerCallback<String, ()>>>: UnsafeUnpin,
PhantomData<Option<ExternalListenerCallback<WorldMapSelectDetail, ()>>>: UnsafeUnpin,
PhantomData<Attribute>: UnsafeUnpin,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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