Unofficial Rust binding for mapbox-gl-js
mapbox-gl-js is an open source library for rendering a beautiful vector-based maps in web browser, built with Mapbox and OSS community. The goal of this project is to create a rust binding for
mapbox-gl-js via WebAssembly so that Rustacean can build webapps with beautiful Mapbox maps only in Rust.
mapbox-gl-rs is in super-duper infant stage. Most of the features are WIP. Please bear with that if you're interested! Also, any contributions e.g. bug reports, feature requests, sending a patch are appreciated.
How does it work?
wasm-bindgen provides a Rust library and tool to compile Rust code into WebAssembly, which allows Rust based application e.g. egui and RustPython to run on web browsers. Most of the people don't know that
mapboxgl to your Cargo.toml
mapboxgl = "0.1.0"
<link href='https://api.mapbox.com/mapbox-gl-js/v2.10.0/mapbox-gl.css' rel='stylesheet' />
Build and run your app. If you are a Yew user, the following command will build and start a web server automatically
- Markers and controls
- Geography and Geometry
- User interaction handlers
- Events and event types
- simple: Hello world
- on-load: Catch the event when the map is loaded
- popup: Show popup control
- geojson-source: Load GeoJSON source and show lines
- set-data: Update paths in realtime using set-data
This project is licensed under the MIT license.