Skip to content

feat: add OSRM Trip HTTP API web demo#40

Merged
DennisOSRM merged 2 commits into
masterfrom
feat/trip-demo
Jun 1, 2026
Merged

feat: add OSRM Trip HTTP API web demo#40
DennisOSRM merged 2 commits into
masterfrom
feat/trip-demo

Conversation

@DennisOSRM

@DennisOSRM DennisOSRM commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Add an interactive MapLibre-based visualization for the OSRM Trip API that allows adding, dragging, and removing up to 25 points, computing an optimized round trip route with live map rendering.

Add an interactive MapLibre-based visualization for the OSRM Trip
API that allows adding, dragging, and removing up to 25 points,
computing an optimized round trip route with live map rendering.
Copilot AI review requested due to automatic review settings June 1, 2026 20:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a standalone, interactive MapLibre-based web demo for the OSRM Trip HTTP API, allowing users to place up to 25 draggable points and visualize the optimized roundtrip route.

Changes:

  • Introduces a new trip.html page with a map + side panel UI for creating/removing points and recomputing a Trip request.
  • Implements client-side Trip API calls (with debouncing and stale-response protection) and renders the returned route geometry + waypoint order.
  • Persists the OSRM server base URL in localStorage for convenience across reloads.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread trip.html
Comment thread trip.html
Comment thread trip.html Outdated
Comment thread trip.html Outdated
Comment thread trip.html
Comment thread trip.html
- Use public router instance as default (https://router.project-osrm.org)
- Move buildTripUrl() inside try block for proper error handling
- Guard error.message with instanceof Error check
- Replace innerHTML with safe DOM node creation
- Add explicit check for empty base URL before constructing URL
- Remove redundant localStorage.setItem in change handler
@DennisOSRM DennisOSRM added this pull request to the merge queue Jun 1, 2026
Merged via the queue into master with commit 5963a5a Jun 1, 2026
1 check passed
@DennisOSRM DennisOSRM deleted the feat/trip-demo branch June 1, 2026 21:23
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.

2 participants