From 4e665f2386dfd567dc6f7c64593ade02b5958b78 Mon Sep 17 00:00:00 2001 From: Marwin Hochfelsner <50826859+hlfan@users.noreply.github.com> Date: Wed, 7 May 2025 20:50:14 +0200 Subject: [PATCH] Add play and stop markers for directions --- app/assets/javascripts/index/directions.js | 4 ++-- app/views/layouts/_markers.html.erb | 2 ++ app/views/layouts/_search.html.erb | 4 ++-- app/views/layouts/map.html.erb | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 33d76583c..463e11d69 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']"), { color: "var(--marker-green)" }, endpointDragCallback, endpointChangeCallback), - OSM.DirectionsEndpoint(map, $("input[name='route_to']"), { color: "var(--marker-red)" }, endpointDragCallback, endpointChangeCallback) + 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) ]; const expiry = new Date(); diff --git a/app/views/layouts/_markers.html.erb b/app/views/layouts/_markers.html.erb index dd7485b5b..f88dfcbf7 100644 --- a/app/views/layouts/_markers.html.erb +++ b/app/views/layouts/_markers.html.erb @@ -17,6 +17,8 @@ "plus" => { :"stroke-linecap" => "round", :d => "M5.75 13h13.5m-6.75-6.75v13.5" }, "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" }, + "play" => { :"stroke-linejoin" => "round", :fill => "#fff", :d => "M10 17.5v-9l7 4.5z" }, + "stop" => { :"stroke-linejoin" => "round", :fill => "#fff", :d => "M9 9.5h7v7H9z" }, "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/_search.html.erb b/app/views/layouts/_search.html.erb index 73c59aebc..f96fad54b 100644 --- a/app/views/layouts/_search.html.erb +++ b/app/views/layouts/_search.html.erb @@ -49,7 +49,7 @@