Skip to content

feat(demo): interactive WebAssembly demo - #49

Merged
gistrec merged 3 commits into
masterfrom
feat/wasm-demo
Oct 7, 2026
Merged

gistrec merged 3 commits into
masterfrom
feat/wasm-demo

Conversation

@gistrec

@gistrec gistrec commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Adds demo/: the library compiled to WebAssembly (embind) with a Leaflet page — distance & bearing, offset, geofence, polyline encode/decode (p5/p6), simplify, snap-to-route, area. Client-side only; Leaflet is vendored, the only external request is OSM tiles.

  • demo/demo_api.hpp is a thin layer over <geo/geo.hpp>; bindings.cpp forwards to it. The library itself is untouched.
  • demo/test/native_ref.cpp + verify.mjs cross-check the WASM build against a native build of the same layer (19 values match).
  • .github/workflows/demo.yml builds, verifies and deploys demo/web to GitHub Pages on master (PRs build and verify only).
  • README gets a one-line link to the demo.

Verified locally with emsdk 6.0.11: geo.wasm is 50 KB (27 KB gzipped); a Playwright smoke test exercised all panels and the mobile layout. The workflow has not run in Actions yet.

demo/: embind wrapper over geo-utils-cpp, seven interactive panels (distance &
bearing, offset, geofence, polyline encode/decode p5/p6, simplify, snap-to-route,
area), a native reference + Node cross-check, and a Pages workflow.
Not built or verified against WASM yet (needs Emscripten).
…s string compare

Verified: WASM (emsdk 6.0.11) matches the native reference on all 19 values,
and a Playwright smoke test exercised all seven panels plus mobile layout.
@gistrec
gistrec merged commit 8980278 into master Oct 7, 2026
14 checks passed
@gistrec
gistrec deleted the feat/wasm-demo branch October 7, 2026 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant