Skip to content

anguschiu1/wasmyroute

Repository files navigation

WasMyRoute

Build and Deploy

Wasmyroute

WasMyRoute is a web application that allows users to create, navigate and record their favorite trail routes and cycling routes. The application is designed to operate on web browsers and once it is loaded, can still be used to track and navigate without internet connection. The application can import tracks and export routes in GPX format.

In future, users can create an account and login to view their saved routes. Users can also view other users routes and save them to their account.

Installation

The project is a WebAssembly applicaton written in Rust. Install wasmyroute by:

rustup target add wasm32-unknown-unknown
cargo install wasm-pack
cargo new --lib wasmyroute

Deployment

Install trunk and other required dependencies

cargo install --locked trunk
cargo install wasm-bindgen-cli
cargo add web-sys
cargo add log

To deploy this project

trunk serve

Running Tests

To run tests, run the following command:

cargo test

To run wasm-bindgen test, install cargo install wasm-bindgen-cli and then run the following command:

wasm-pack test --safari

You will also need to open Safari window to see the result.

Or you can test under headless mode:

wasm-pack test --headless --firefox

Tech Stack

Client: WebAssembly, Rust, Yew

Acknowledgements

  • I learnt so much from him through his blog

Key resources

Osmium Tool Manual - osmcode

Very useful OSM export resource - HOT Export Tool

Export by countries cities

Sketch GPX file - gpx.studio — the online GPX file editor

Script-like tools to fetch OSM - overpass turbo

Rust for beginners: GPX Analyzer - how to find the best GPS tracks in apps like Strava or Nike Run Club

Managing OSM files

Brew install osmium tool to manage OSM files

brew install osmium-tool

Examples:

osmium fileinfo Cambridgeshire_UK.osm.pbf
osmium fileinfo -e Cambridgeshire_UK.osm.pbf
osmium show Cambridgeshire_UK.osm.pbf
osmium cat Cambridgeshire_UK.osm.pbf -o Cambridgeshire_UK.osm
osmium cat ukmap.osm -o ukmap.osm.pbf

Concatenate to stdout for other programs

osmium cat Cambridgeshire_UK.osm.pbf -f osm | cargo +nightly run

where -f specified the output format

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published