-
Notifications
You must be signed in to change notification settings - Fork 0
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
Rewrite the route snapper #8
Conversation
Remove the option to avoid doubling back. It doesn't have much effect on spurs in general and has only confused users Rethink the route snapper state management from scratch -- move it to the Svelte side. Use markers for managing waypoints. Basic idea started, but no intermediate waypoints yet Introduce explicit modes. Show intermediate waypoints as more markers. Inserting them doesn't quite work yet, but started. Switch to new stateless WASM API. Intermediate nodes are now properly insertable, but not yet draggable Show preview when appending/prepending Merge with draw toolbar changes (leaving some problems)
after releasing the drag.
c82a5cb
to
1ef7cc3
Compare
… out some of the old stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good apart from a couple of functions which looked now unused to me
controls = "route"; | ||
} else if (feature.geometry.type == "Polygon") { | ||
if (feature.properties.waypoints) { | ||
$routeTool?.editExistingArea(feature as Feature<Polygon, AreaProps>); | ||
$routeTool?.addEventListenerSuccess(onSuccess); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to now delete these functions? looks like they're no longer used to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addEventListenerSuccess
and such? They're in the upstream package https://github.com/dabreegster/route_snapper/blob/main/route-snapper-ts/src/index.ts. We essentially stop using route-snapper-ts
in this PR, using part of the WASM API directly. I'm still depending on route-snapper-ts here for now to get RouteProps
and a few convenient definitions, but could maybe clean that up later too
This is a total refresh of the idea of the route and area snapper:
I think this PR represents the MVP. #9 has some smaller followups that aren't critical.
Demo: Run locally or https://acteng.github.io/atip/route_snapper_next_gen/files.html?authority=TA_West%20Yorkshire%20Combined%20Authority&schema=v2