use-map-scale 0.1.0

Primitive map scale vocabulary for RustUse
Documentation
  • Coverage
  • 17.65%
    3 out of 17 items documented1 out of 14 items with examples
  • Size
  • Source code size: 7.55 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 643.81 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 5s Average build duration of successful builds.
  • all releases: 5s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-geography
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-map-scale

Primitive map scale vocabulary for RustUse.

use-map-scale provides small descriptive types for scale ratios, map scale, map resolution, and zoom levels without implementing map tile behavior.

Non-goals

  • tile math
  • slippy-map logic
  • map rendering
  • map-tile fetching

Example

use use_map_scale::{MapResolution, MapScale, ScaleRatio, ZoomLevel};

# fn main() -> Result<(), Box<dyn std::error::Error>> {
let ratio = ScaleRatio::new(25_000)?;
let scale = MapScale::new(ratio);
let resolution = MapResolution::new(2.5)?;
let zoom = ZoomLevel::new(10);

assert_eq!(scale.to_string(), "1:25000");
assert_eq!(resolution.units_per_pixel(), 2.5);
assert_eq!(zoom.level(), 10);
# Ok(())
# }