[openstreetmap/openstreetmap-website] Add demo links for routing engine directions Fixes #6387 (PR #6693)

Marwin Hochfelsner notifications at github.com
Sat Jan 10 22:59:34 UTC 2026


@hlfan commented on this pull request.



> +        const meta = {
+          credit: "GraphHopper",
+          creditlink: "https://www.graphhopper.com/",
+          demolink: `https://graphhopper.com/maps/?point=${points[0].lat}%2C${points[0].lng}&point=${points[1].lat}%2C${points[1].lng}&profile=${DEMO_PARAMS[modeId]}`
+        };
         points.forEach(p => query.append("point", p.lat + "," + p.lng));

Using the `URLSearchParams` API would make this a bit more readable:

```suggestion
        const demoQuery = new URLSearchParams({ profile: vehicleType });
        for (const { lat, lng } of points) {
          query.append("point", [lat, lng]);
          demoQuery.append("point", [lat, lng]);
        }
        const meta = {
          credit: "GraphHopper",
          creditlink: "https://www.graphhopper.com/",
          demolink: "https://graphhopper.com/maps/?" + demoQuery
        };
```

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6693#pullrequestreview-3647264613
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6693/review/3647264613 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260110/e73e92fe/attachment.htm>


More information about the rails-dev mailing list