//! Write a real `.pmtiles` archive to disk so the canonical pmtiles readers //! (JS/Go/Python) can be pointed at it — proves the writer is interoperable, //! not just self-consistent. use map_pmtiles::{write, TileType}; use serde_json::json; fn main() { let path = std::env::args().nth(1).unwrap_or_else(|| "/tmp/map_demo.pmtiles".to_string()); let tiles = vec![ (0u8, 0u32, 0u32, b"hello-root".to_vec()), (2, 1, 1, b"tile-2-1-1".to_vec()), (2, 3, 2, b"tile-2-3-2".to_vec()), (14, 8000, 5000, b"deep-tile".to_vec()), ]; let archive = write( tiles, &json!({ "name": "map-demo", "attribution": "transaction.science" }), TileType::Mvt, ); std::fs::write(&path, &archive).expect("write archive"); println!("wrote {} bytes to {path}", archive.len()); }