pub struct MapBuilder { /* private fields */ }Expand description
Collects areas and lines in metres around an origin and packs them into
MapData. Layers draw in the order they were added.
Implementations§
Source§impl MapBuilder
impl MapBuilder
Sourcepub fn point(&self, lat: f64, lon: f64) -> Point
pub fn point(&self, lat: f64, lon: f64) -> Point
lat, lon in metres east and south of the origin; an
equirectangular projection, fine for a city.
Sourcepub fn layer(&mut self, color: Color, min_scale: f32) -> Layer
pub fn layer(&mut self, color: Color, min_scale: f32) -> Layer
A layer drawn in color, hidden while zoomed out below min_scale
logical px per metre (0 always shows it).
Sourcepub fn area(
&mut self,
layer: Layer,
outers: &[Vec<Point>],
holes: &[Vec<Point>],
)
pub fn area( &mut self, layer: Layer, outers: &[Vec<Point>], holes: &[Vec<Point>], )
A filled area, e.g. an OSM multipolygon: outers filled, holes cut
out of them. Rings may wind either way.
Sourcepub fn line(&mut self, layer: Layer, points: &[Point], width: f32)
pub fn line(&mut self, layer: Layer, points: &[Point], width: f32)
A line width metres wide through points, with round caps and
bevelled joins.
Sourcepub fn label(
&mut self,
layer: Layer,
points: &[Point],
text: &Text,
font: Font,
s: &str,
size: f32,
) -> bool
pub fn label( &mut self, layer: Layer, points: &[Point], text: &Text, font: Font, s: &str, size: f32, ) -> bool
s at size metres along the polyline, e.g. a street’s name inside
it: centred, reading left to right, each glyph turned to the line
under its middle. Shows once size reaches [MIN_LABEL_PX] and the
same text placed earlier is [LABEL_SPACING_PX] away; false,
adding nothing, when the text is longer than the line or the line
bends too sharply under it.
Auto Trait Implementations§
impl !RefUnwindSafe for MapBuilder
impl !Send for MapBuilder
impl !Sync for MapBuilder
impl Forget for MapBuilder
impl Freeze for MapBuilder
impl Move for MapBuilder
impl Unpin for MapBuilder
impl UnsafeUnpin for MapBuilder
impl UnwindSafe for MapBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.