pub struct GeoPoint { /* private fields */ }Expand description
A validated WGS84-style latitude and longitude pair in degrees.
Implementations§
Source§impl GeoPoint
impl GeoPoint
Sourcepub fn new(latitude: f64, longitude: f64) -> Result<Self, MapError>
pub fn new(latitude: f64, longitude: f64) -> Result<Self, MapError>
Creates a point with latitude in [-90, 90] and longitude in [-180, 180].
Examples found in repository?
examples/layout_labels.rs (line 13)
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§
impl Copy for GeoPoint
impl StructuralPartialEq for GeoPoint
Auto Trait Implementations§
impl Freeze for GeoPoint
impl RefUnwindSafe for GeoPoint
impl Send for GeoPoint
impl Sync for GeoPoint
impl Unpin for GeoPoint
impl UnsafeUnpin for GeoPoint
impl UnwindSafe for GeoPoint
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