[openstreetmap/openstreetmap-website] Get directions using fetch (PR #5642)

Holger Jeromin notifications at github.com
Tue Feb 11 07:24:57 UTC 2025


@HolgerJeromin commented on this pull request.



> -    routeRequest = chosenEngine.getRoute(points, function (err, route) {
-      routeRequest = null;
-
-      if (err) {
-        map.removeLayer(polyline);
-
-        if (reportErrors) {
-          $("#sidebar_content").html("<div class=\"alert alert-danger\">" + I18n.t("javascripts.directions.errors.no_route") + "</div>");
-        }
-
-        return;
-      }
-
+    controller = new AbortController();
+    awaitingRoute = true;
+    chosenEngine.getRoute(points, controller.signal).then(function (route) {
       polyline

Add `controller = undefined;` here. Same in `catch`

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

Message ID: <openstreetmap/openstreetmap-website/pull/5642/review/2607888204 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250210/ca5dae0c/attachment.htm>


More information about the rails-dev mailing list