#cartography #brisk #style #map #declarative #layer #symbol

macro brisk-cartography

Use of the brisk declarative engine with cartography

5 unstable releases

new 0.3.2 Feb 15, 2025
0.3.1 Jan 27, 2025
0.3.0 Jan 14, 2025
0.2.0 Dec 30, 2024
0.1.0 Dec 18, 2024

#787 in Procedural macros

Download history 124/week @ 2024-12-17 82/week @ 2024-12-24 49/week @ 2024-12-31 2/week @ 2025-01-07 102/week @ 2025-01-14 53/week @ 2025-01-21 58/week @ 2025-01-28 28/week @ 2025-02-04 127/week @ 2025-02-11

270 downloads per month

MIT license

27KB
525 lines

stable pipeline dev/1 pipeline docs crates.io

brisk-cartography

brisk-cartography provides integration with the cartography.

Example

The following creates a map with a single layer loaded with geojson:

brisk_cartography::brisk_it! {
    Map
    {
        GeoJsonLayer
        {
            name: "Continents",
            source: include_str!("../data/continents.json").as_bytes(),
        }
    }
}

The following defines a style to show the continents with a black outline, and a white background:

brisk_cartography::brisk_it! {
    Style
    {
        background_color: cartography::Rgba::OSM_BLUE,
        Rule {
            geo_type: cartography::GeometryType::Polygon,
            symbol: Symbol {
                stroke_width: 1.0,
                stroke_color: cartography::Rgba::BLACK.into(),
                fill_color: cartography::Rgba::OSM_WHITE.into(),
                },
        }
    }
}

The full example is available in the cartography example.

Dependencies

~220–660KB
~16K SLoC