diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index 3b1f63f8b..802a39b4f 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -17,6 +17,4 @@ //= link_tree ../../../vendor/assets/leaflet .png -//= link leaflet/dist/images/marker-icon.png -//= link leaflet/dist/images/marker-icon-2x.png //= link leaflet/dist/images/marker-shadow.png diff --git a/app/assets/images/marker-blue.png b/app/assets/images/marker-blue.png deleted file mode 100644 index 98b672616..000000000 Binary files a/app/assets/images/marker-blue.png and /dev/null differ diff --git a/app/assets/images/marker-blue.svg b/app/assets/images/marker-blue.svg new file mode 100644 index 000000000..4d8a8477a --- /dev/null +++ b/app/assets/images/marker-blue.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/app/assets/images/marker-from.svg b/app/assets/images/marker-from.svg new file mode 100644 index 000000000..2f4e4fb7f --- /dev/null +++ b/app/assets/images/marker-from.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/app/assets/images/marker-green.png b/app/assets/images/marker-green.png deleted file mode 100644 index f0e64e747..000000000 Binary files a/app/assets/images/marker-green.png and /dev/null differ diff --git a/app/assets/images/marker-green.svg b/app/assets/images/marker-green.svg new file mode 100644 index 000000000..ef2ce1962 --- /dev/null +++ b/app/assets/images/marker-green.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/app/assets/images/marker-note-closed.svg b/app/assets/images/marker-note-closed.svg index 84e1048a4..b10256403 100644 --- a/app/assets/images/marker-note-closed.svg +++ b/app/assets/images/marker-note-closed.svg @@ -1,19 +1,20 @@ - + - - - + + + - - - + + + + - - - - - - + + + + + + diff --git a/app/assets/images/marker-note-new.svg b/app/assets/images/marker-note-new.svg index c84444b5b..c4c85aab0 100644 --- a/app/assets/images/marker-note-new.svg +++ b/app/assets/images/marker-note-new.svg @@ -1,15 +1,20 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + + diff --git a/app/assets/images/marker-note-open.svg b/app/assets/images/marker-note-open.svg index a1b4381c6..bd0ceae82 100644 --- a/app/assets/images/marker-note-open.svg +++ b/app/assets/images/marker-note-open.svg @@ -1,19 +1,20 @@ - + - - - + + + - - - + + + + - - - - - - + + + + + + diff --git a/app/assets/images/marker-red.png b/app/assets/images/marker-red.png deleted file mode 100644 index 5ea2a6cc4..000000000 Binary files a/app/assets/images/marker-red.png and /dev/null differ diff --git a/app/assets/images/marker-red.svg b/app/assets/images/marker-red.svg new file mode 100644 index 000000000..348bd1c32 --- /dev/null +++ b/app/assets/images/marker-red.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/app/assets/images/marker-to.svg b/app/assets/images/marker-to.svg new file mode 100644 index 000000000..69d905088 --- /dev/null +++ b/app/assets/images/marker-to.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/app/assets/javascripts/embed.js.erb b/app/assets/javascripts/embed.js.erb index 7596e89a4..66c298a37 100644 --- a/app/assets/javascripts/embed.js.erb +++ b/app/assets/javascripts/embed.js.erb @@ -59,10 +59,10 @@ window.onload = function () { if (args.marker) { L.marker(args.marker.split(","), { icon: L.icon({ - iconUrl: <%= asset_path('leaflet/dist/images/marker-icon.png').to_json %>, + iconUrl: <%= image_path("marker-blue.svg").to_json %>, iconSize: new L.Point(25, 41), iconAnchor: new L.Point(12, 41), - shadowUrl: <%= asset_path('leaflet/dist/images/marker-shadow.png').to_json %>, + shadowUrl: <%= image_path("leaflet/dist/images/marker-shadow.png").to_json %>, shadowSize: new L.Point(41, 41) }) }).addTo(map); } diff --git a/app/assets/javascripts/index/directions.js b/app/assets/javascripts/index/directions.js index 89888bbd1..6b51d5597 100644 --- a/app/assets/javascripts/index/directions.js +++ b/app/assets/javascripts/index/directions.js @@ -33,8 +33,8 @@ OSM.Directions = function (map) { }; const endpoints = [ - OSM.DirectionsEndpoint(map, $("input[name='route_from']"), OSM.MARKER_GREEN, endpointDragCallback, endpointChangeCallback), - OSM.DirectionsEndpoint(map, $("input[name='route_to']"), OSM.MARKER_RED, endpointDragCallback, endpointChangeCallback) + OSM.DirectionsEndpoint(map, $("input[name='route_from']"), OSM.MARKER_FROM, endpointDragCallback, endpointChangeCallback), + OSM.DirectionsEndpoint(map, $("input[name='route_to']"), OSM.MARKER_TO, endpointDragCallback, endpointChangeCallback) ]; let downloadURL = null; diff --git a/app/assets/javascripts/leaflet.map.js b/app/assets/javascripts/leaflet.map.js index 6adf2138d..44ad80e51 100644 --- a/app/assets/javascripts/leaflet.map.js +++ b/app/assets/javascripts/leaflet.map.js @@ -373,8 +373,8 @@ L.OSM.Map = L.Map.extend({ L.Icon.Default.imagePath = "/images/"; L.Icon.Default.imageUrls = { - "/images/marker-icon.png": OSM.MARKER_ICON, - "/images/marker-icon-2x.png": OSM.MARKER_ICON_2X, + "/images/marker-icon.png": OSM.MARKER_BLUE, + "/images/marker-icon-2x.png": OSM.MARKER_BLUE, "/images/marker-shadow.png": OSM.MARKER_SHADOW }; diff --git a/app/assets/javascripts/osm.js.erb b/app/assets/javascripts/osm.js.erb index 9550ded49..02145d149 100644 --- a/app/assets/javascripts/osm.js.erb +++ b/app/assets/javascripts/osm.js.erb @@ -32,17 +32,19 @@ OSM = { LAYER_DEFINITIONS: <%= YAML.load_file(Rails.root.join("config/layers.yml")).to_json %>, LAYERS_WITH_MAP_KEY: <%= YAML.load_file(Rails.root.join("config/key.yml")).keys.to_json %>, - MARKER_GREEN: <%= image_path("marker-green.png").to_json %>, - MARKER_RED: <%= image_path("marker-red.png").to_json %>, - - MARKER_ICON: <%= image_path("leaflet/dist/images/marker-icon.png").to_json %>, - MARKER_ICON_2X: <%= image_path("leaflet/dist/images/marker-icon-2x.png").to_json %>, - MARKER_SHADOW: <%= image_path("leaflet/dist/images/marker-shadow.png").to_json %>, + MARKER_RED: <%= image_path("marker-red.svg").to_json %>, + MARKER_GREEN: <%= image_path("marker-green.svg").to_json %>, + MARKER_BLUE: <%= image_path("marker-blue.svg").to_json %>, MARKER_NOTE_NEW: <%= image_path("marker-note-new.svg").to_json %>, MARKER_NOTE_OPEN: <%= image_path("marker-note-open.svg").to_json %>, MARKER_NOTE_CLOSED: <%= image_path("marker-note-closed.svg").to_json %>, + MARKER_FROM: <%= image_path("marker-from.svg").to_json %>, + MARKER_TO: <%= image_path("marker-to.svg").to_json %>, + + MARKER_SHADOW: <%= image_path("leaflet/dist/images/marker-shadow.png").to_json %>, + apiUrl: function (object) { const apiType = object.type === "note" ? "notes" : object.type; let url = "/api/" + OSM.API_VERSION + "/" + apiType + "/" + object.id; diff --git a/app/views/dashboards/_contact.html.erb b/app/views/dashboards/_contact.html.erb index 021f1a335..378bc7141 100644 --- a/app/views/dashboards/_contact.html.erb +++ b/app/views/dashboards/_contact.html.erb @@ -1,7 +1,7 @@ <% user_data = { :lon => contact.home_lon, :lat => contact.home_lat, - :icon => image_path(type == "following" ? "marker-blue.png" : "marker-green.png"), + :icon => image_path(type == "following" ? "marker-blue.svg" : "marker-green.svg"), :description => render(:partial => "popup", :object => contact, :locals => { :type => type }) } %> <%= tag.div :class => "clearfix row", :data => { :user => user_data } do %> diff --git a/app/views/dashboards/show.html.erb b/app/views/dashboards/show.html.erb index e110ad531..1879e46a2 100644 --- a/app/views/dashboards/show.html.erb +++ b/app/views/dashboards/show.html.erb @@ -15,7 +15,7 @@ <% user_data = { :lon => current_user.home_lon, :lat => current_user.home_lat, - :icon => image_path("marker-red.png"), + :icon => image_path("marker-red.svg"), :description => render(:partial => "popup", :object => current_user, :locals => { :type => "your location" }) } %> <%= tag.div "", :id => "map", :class => "content_map border border-secondary-subtle rounded z-0", :data => { :user => user_data } %> diff --git a/app/views/layouts/_search.html.erb b/app/views/layouts/_search.html.erb index 706d27a99..db4919045 100644 --- a/app/views/layouts/_search.html.erb +++ b/app/views/layouts/_search.html.erb @@ -44,13 +44,13 @@
- <%= image_tag "marker-green.png", :class => "img-fluid", :data => { :type => "from" }, :draggable => "true" %> + <%= image_tag "marker-from.svg", :class => "img-fluid", :data => { :type => "from" }, :draggable => "true" %>
<%= text_field_tag "route_from", params[:from], :placeholder => t("site.search.from"), :autocomplete => "on", :class => "form-control py-1 px-2", :dir => "auto" %>
- <%= image_tag "marker-red.png", :class => "img-fluid", :data => { :type => "to" }, :draggable => "true" %> + <%= image_tag "marker-to.svg", :class => "img-fluid", :data => { :type => "to" }, :draggable => "true" %>
<%= text_field_tag "route_to", params[:to], :placeholder => t("site.search.to"), :autocomplete => "on", :class => "form-control py-1 px-2", :dir => "auto" %>