Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Draw route between two coordinates without UI #59

Open
danielbeeke opened this issue Sep 2, 2024 · 1 comment
Open

Question: Draw route between two coordinates without UI #59

danielbeeke opened this issue Sep 2, 2024 · 1 comment

Comments

@danielbeeke
Copy link

Should I import the WASM directly for this use case? or is there some method that would do this already?

@dabreegster
Copy link
Owner

You could use

editExistingRoute(feature: Feature<LineString, RouteProps>) {
in the TS library, then read out routeToolGj there. This is from the newer TS library that's on NPM, but sadly undocumented.

Or to avoid the maplibre dependencies entirely, just go through the WASM API, adding two snapped waypoints.

If your goal is to just calculate routes from OSM data in JS, using this project might be a heavyweight option, but it does work.

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

No branches or pull requests

2 participants