From d531b22ec3d6471e00109293249019d67cd69fbb Mon Sep 17 00:00:00 2001 From: Anshul Zilpe Date: Fri, 16 Jan 2026 20:35:10 +0530 Subject: [PATCH] Update route markers and context menu icons to cursor/flag metaphor Renames 'play'/'stop' to 'start'/'destination' and updates icons to standard navigation metaphors. --- app/assets/javascripts/index/contextmenu.js | 7 +++---- app/assets/javascripts/index/directions.js | 4 ++-- app/views/layouts/_markers.html.erb | 4 ++-- app/views/layouts/map.html.erb | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/index/contextmenu.js b/app/assets/javascripts/index/contextmenu.js index 332bb46f9..4dcc0d8d7 100644 --- a/app/assets/javascripts/index/contextmenu.js +++ b/app/assets/javascripts/index/contextmenu.js @@ -34,7 +34,7 @@ OSM.initializations.push(function (map) { const contextmenuItems = [ { id: "menu-action-directions-from", - icon: "bi-play", + icon: "bi-cursor", text: OSM.i18n.t("javascripts.context.directions_from"), callback: () => { const params = new URLSearchParams({ @@ -46,7 +46,7 @@ OSM.initializations.push(function (map) { }, { id: "menu-action-directions-to", - icon: "bi-stop", + icon: "bi-flag", text: OSM.i18n.t("javascripts.context.directions_to"), callback: () => { const params = new URLSearchParams({ @@ -88,7 +88,6 @@ OSM.initializations.push(function (map) { } ]; - // Event bindings map.on("contextmenu", function (e) { map.osm_contextmenu.show(e, contextmenuItems); updateContextMenuState(); @@ -159,7 +158,7 @@ class ContextMenu { { name: "offset", options: { - offset: [0, 0] // no offset, exactly aligned to placement corner + offset: [0, 0] } }, { diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index f5dc4e050..350bd7b7c 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -24,8 +24,8 @@ OSM.Directions = function (map) { }; const endpoints = [ - OSM.DirectionsEndpoint(map, $("input[name='route_from']"), { icon: "play", color: "var(--marker-green)" }, endpointDragCallback, endpointChangeCallback), - OSM.DirectionsEndpoint(map, $("input[name='route_to']"), { icon: "stop", color: "var(--marker-red)" }, endpointDragCallback, endpointChangeCallback) + OSM.DirectionsEndpoint(map, $("input[name='route_from']"), { icon: "start", color: "var(--marker-green)" }, endpointDragCallback, endpointChangeCallback), + OSM.DirectionsEndpoint(map, $("input[name='route_to']"), { icon: "destination", color: "var(--marker-red)" }, endpointDragCallback, endpointChangeCallback) ]; const expires = new Date(); diff --git a/app/views/layouts/_markers.html.erb b/app/views/layouts/_markers.html.erb index c82d61242..71aba1820 100644 --- a/app/views/layouts/_markers.html.erb +++ b/app/views/layouts/_markers.html.erb @@ -18,8 +18,8 @@ "tick" => { :"stroke-linecap" => "round", :"stroke-linejoin" => "round", :fill => "none", :d => "M7.157 14.649Q8.9 16 11.22 18.761 14.7 11.7 17.843 8.239" }, "cross" => { :"stroke-linecap" => "round", :d => "m7.5 8 10 10m0-10-10 10" }, "minus" => { :"stroke-linecap" => "round", :d => "M5.75 13h13.5" }, - "play" => { :"stroke-linejoin" => "round", :fill => "#fff", :d => "M10 17.5v-9l7 4.5z" }, - "stop" => { :"stroke-linejoin" => "round", :fill => "#fff", :d => "M9 9.5h7v7H9z" }, + "start" => { :"stroke-linejoin" => "round", :fill => "#fff", :d => "M5.5 13h7v7l5-12z" }, + "destination" => { :"stroke-linecap" => "round", :"stroke-linejoin" => "round", :fill => "#fff", :d => "M10 21 7 9c5-3 6 2 11 0l1 4c-5 2-6-3-11 0" }, "dot" => { :"stroke-linecap" => "round", :fill => "#fff", :d => "M11.5 10a1 1 0 0 0 2 5 1 1 0 0 0-2-5" } } %> diff --git a/app/views/layouts/map.html.erb b/app/views/layouts/map.html.erb index eb90d8704..3d6c0641f 100644 --- a/app/views/layouts/map.html.erb +++ b/app/views/layouts/map.html.erb @@ -51,7 +51,7 @@ <%= render :partial => "layouts/control_icons" %> - <%= render :partial => "layouts/markers", :locals => { :types => %w[dot cross tick plus play stop] } %> + <%= render :partial => "layouts/markers", :locals => { :types => %w[dot cross tick plus start destination] } %>