#leptos #map #leaflet #component #view #draw

kapta

Kapta ~ Inspired by leaflet. Draw map with wasm

5 releases

0.0.4 Nov 7, 2023
0.0.3 Oct 27, 2023
0.0.2 Oct 26, 2023
0.0.1 Oct 26, 2023
0.0.0 Oct 18, 2023

#194 in Geospatial


Used in leptos_kapta

MIT license

23KB
555 lines

Kapta

Inspired by leaflet

Examples and Usage

Integrate leptos

Cargo.toml

kapta = {version = "0.0.2"}
leptos_kapta = {version = "0.0.2"}
leptos = {version = "0.5"}

main.rs

use leptos::*;
use leptos_kapta::{Kapta, KaptaCoord};

fn main() {    
    mount_to_body(|| leptos::view! { <App/> })
}

#[component]
pub fn App() -> impl IntoView {
    let center: KaptaCoord = KaptaCoord::new(106.645, 10.788);
    view! {
        <div class="mx-auto">
            <h1 class="text-center m-8 text-2xl ">Example with leptos</h1>
            <div class="flex justify-center">
                <Kapta zoom=3 width=900 height=700 center=center/>
            </div>
        </div>
    }
}

Result

Leptos Example

Currently the library is in the development stage

Dependencies

~7MB
~118K SLoC