[openstreetmap/openstreetmap-website] Enable exporting direction paths (PR #5694)

Holger Jeromin notifications at github.com
Mon Feb 17 11:29:02 UTC 2025


@HolgerJeromin commented on this pull request.



> @@ -189,6 +192,20 @@ OSM.Directions = function (map) {
         turnByTurnTable.append(row);
       });
 
+      const download = exportGroup.toGeoJSON();
+      for (const i in endpoints) {
+        download.features[i].properties["marker-color"] = endpoints[i].marker.getElement().src.match(/marker-(\w+)/)[1];
+      }
+      const blob = new Blob([JSON.stringify(download)], { type: "application/json" });
+      URL.revokeObjectURL(downloadURL);
+      downloadURL = URL.createObjectURL(blob);
+
+      $("#sidebar_content").append(`<p class="text-center"><a href="${downloadURL}" download="${

oh. yes. I did not checked the whole file 🤦

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

Message ID: <openstreetmap/openstreetmap-website/pull/5694/review/2620787770 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250217/e1bdd5ed/attachment.htm>


More information about the rails-dev mailing list