pub struct MapFeature { /* private fields */ }Expand description
A labeled geographic feature and its visible zoom interval.
Implementations§
Source§impl MapFeature
impl MapFeature
Sourcepub fn new(
id: impl Into<String>,
point: GeoPoint,
label: LocalizedLabel,
priority: LabelPriority,
min_zoom: u8,
max_zoom: u8,
) -> Result<Self, MapError>
pub fn new( id: impl Into<String>, point: GeoPoint, label: LocalizedLabel, priority: LabelPriority, min_zoom: u8, max_zoom: u8, ) -> Result<Self, MapError>
Creates a feature visible between the inclusive zoom limits.
Examples found in repository?
examples/layout_labels.rs (lines 11-18)
3fn feature(
4 id: &str,
5 latitude: f64,
6 longitude: f64,
7 priority: LabelPriority,
8) -> Result<MapFeature, map_expressions::MapError> {
9 let mut label = LocalizedLabel::new();
10 label.insert("ja", id)?;
11 MapFeature::new(
12 id,
13 GeoPoint::new(latitude, longitude)?,
14 label,
15 priority,
16 0,
17 20,
18 )
19}Trait Implementations§
Source§impl Clone for MapFeature
impl Clone for MapFeature
Source§impl Debug for MapFeature
impl Debug for MapFeature
Source§impl PartialEq for MapFeature
impl PartialEq for MapFeature
impl StructuralPartialEq for MapFeature
Auto Trait Implementations§
impl Freeze for MapFeature
impl RefUnwindSafe for MapFeature
impl Send for MapFeature
impl Sync for MapFeature
impl Unpin for MapFeature
impl UnsafeUnpin for MapFeature
impl UnwindSafe for MapFeature
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