This is a demonstration of gluing a Leaflet Javascript web map to the Rust zonebuilder crate. You can use this to draw a clockboard and download the GeoJSON.
These instructions will be improved soon. I think using npm probably simplifies things, and we can hook up automatic deployment to Github pages.
But for now:
- Install wasm-pack if you haven't before, e.g. with
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - Compile the Rust code to WebAssembly. Run this from the root directory of the
zonebuilder-rustproject:
wasm-pack build --target web -- --features wasmAfter a few seconds compiling, you should see a message saying something like:
# [INFO]: :-) Done in 30.20s
# [INFO]: :-) Your wasm pkg is ready to publish at /home/robin/orgs/zonebuilders/zonebuilder-rust/pkg.If so, it worked!
- Set your working directory to the
webfolder and serve the map as follows:
cd web
./serve_locally.py- Open http://0.0.0.0:8000/ in your browser. You should see web-based graphical user interface for generating zoning systems.