[openstreetmap/openstreetmap-website] Store routing icons separately (PR #6189)

Marwin Hochfelsner notifications at github.com
Sun Jul 13 22:30:19 UTC 2025


@hlfan commented on this pull request.



> -    <path d="M9 14 v-8" opacity=".5" />
-    <path d="M9 17 v-3 q0 -2 2 -4 l5 -5 m0 0 h-3 l3 3 z" />
-  </symbol>
-  <symbol id="routing-sprite-exit-left">
-    <use href="#routing-sprite-exit-right" transform="matrix(-1 0 0 1 20 0)" />
-  </symbol>
-
-  <symbol id="routing-sprite-ferry" fill="none" stroke="currentColor" stroke-width="1">
-    <path d="M10.5 8 l-6 2 l2.5 2 v1.5 a2.828 2.828 0 0 1 1.5 1 a2.828 2.828 0 0 1 4 0 a2.828 2.828 0 0 1 1.5 -1 v-1.5 l2.5 -2 z" fill="currentColor" />
-    <path d="M6.5 9.5 v-5 h8 v5 m-5.5 -6 h3" />
-    <path d="M5.5 16.5 a1.414 2.828 0 0 1 2 0 a1.414 2.828 0 0 0 2 0 a1.414 2.828 0 0 1 2 0 a1.414 2.828 0 0 0 2 0 a1.414 2.828 0 0 1 2 0" />
-  </symbol>
+<svg class="d-none">
+  <% Rails.root.glob("app/assets/images/routing/*.svg").each do |path| %>
+    <%= inline_svg_tag "routing/#{File.basename(path)}", :id => "routing-sprite-#{File.basename(path, '.svg')}", :to_symbol => true %>
+  <% end %>
 </svg>

No, that's exactly my plan.
I've decided to move the right and sharp right turn icons 1px toward the center so that these start at the same point as the slight right turn icon.
That means I can use the `transform="matrix(-1 0 0 1 20 0)"` for every icon.

<img width="539" height="222" alt="image" src="https://github.com/user-attachments/assets/ce5fdd5e-deda-47f9-bcad-ec1c7d64c972" />

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

Message ID: <openstreetmap/openstreetmap-website/pull/6189/review/3014350785 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250713/34a2255a/attachment.htm>


More information about the rails-dev mailing list