Struct staticmap::StaticMap[][src]

pub struct StaticMap { /* fields omitted */ }

Main type. Use StaticMapBuilder as an entrypoint.

Example

use staticmap::StaticMapBuilder;

let mut map = StaticMapBuilder::default()
    .width(300)
    .height(300)
    .zoom(4)
    .lat_center(52.6)
    .lon_center(13.4)
    .build()
    .unwrap();

Implementations

impl StaticMap[src]

pub fn add_line(&mut self, line: Line)[src]

Add a Line instance. The map can contain several lines.

pub fn add_marker(&mut self, marker: impl Marker + 'static)[src]

Add a type implementing Marker. The map can contain several markers.

pub fn encode_png(&mut self) -> Result<Vec<u8>, StaticMapError>[src]

Render the map and encode as png.

May panic if any feature has invalid bounds.

pub fn save_png<P: AsRef<Path>>(
    &mut self,
    path: P
) -> Result<(), StaticMapError>
[src]

Render the map and save as png to a file.

May panic if any feature has invalid bounds.

Auto Trait Implementations

impl !RefUnwindSafe for StaticMap

impl !Send for StaticMap

impl !Sync for StaticMap

impl Unpin for StaticMap

impl !UnwindSafe for StaticMap

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.