Crate snapr

Source
Expand description

§Snapr

Snapr (/ˈsnæp ər/) is a library that enables a flexible and frictionless way to render snapshots of maps with overlayed geometries.

§Examples

  • Open Street Maps - Collection of binaries using an OSM tile fetcher.
    • Point - Example showing how to draw a point geometry.
    • Line - Example showing how to draw a line geometry.
    • Line String - Example showing how to draw a line string geometry.
    • Polygon - Example showing how to draw a polygon geometry.
  • Labels - Example showing how to label a point geometry.
  • SVGs - Example showing how to draw an SVG on top of a point geometry.
  • Batch - Example showing how to use a TileFetcher::Batch, as opposed to the usual TileFetcher::Individual variant.
  • Stateful - Example showing how to implement the IndividualTileFetcher trait to enable a TileFetcher that keeps track of state.
  • Tokio - Example showing how to use the tokio feature flag to build an asynchronous TileFetcher.

§License

Licensed under the MIT License found at the root of the repository.

Re-exports§

pub use fetchers::TileFetcher;
pub use geo;
pub use image;
pub use tiny_skia;

Modules§

drawing
Contains utilities to draw objects on top of map tiles.
fetchers
Module containing definitions and implementations for tile fetching traits. See TileFetcher for more details.

Structs§

Snapr
Utility structure to generate snapshots. Should be normally constructed through building with SnaprBuilder.
SnaprBuilder
Builder structure for Snapr.

Enums§

Error
Error type used throughout the snapr crate.
Zoom
Used by Snapr to determine how the zoom level is calculated when generating snapshots.