From 59dcd82eb9ccce11286081a43f2a5e47f6b5caed Mon Sep 17 00:00:00 2001 From: Marwin Hochfelsner <50826859+hlfan@users.noreply.github.com> Date: Fri, 7 Mar 2025 15:56:08 +0100 Subject: [PATCH] Overhaul markers --- app/assets/config/manifest.js | 2 -- app/assets/images/marker-blue.png | Bin 1519 -> 0 bytes app/assets/images/marker-blue.svg | 20 +++++++++++++ app/assets/images/marker-from.svg | 20 +++++++++++++ app/assets/images/marker-green.png | Bin 1462 -> 0 bytes app/assets/images/marker-green.svg | 20 +++++++++++++ app/assets/images/marker-note-closed.svg | 27 +++++++++--------- app/assets/images/marker-note-new.svg | 31 ++++++++++++--------- app/assets/images/marker-note-open.svg | 27 +++++++++--------- app/assets/images/marker-red.png | Bin 1462 -> 0 bytes app/assets/images/marker-red.svg | 20 +++++++++++++ app/assets/images/marker-to.svg | 20 +++++++++++++ app/assets/javascripts/embed.js.erb | 4 +-- app/assets/javascripts/index/directions.js | 4 +-- app/assets/javascripts/leaflet.map.js | 4 +-- app/assets/javascripts/osm.js.erb | 14 ++++++---- app/views/dashboards/_contact.html.erb | 2 +- app/views/dashboards/show.html.erb | 2 +- app/views/layouts/_search.html.erb | 4 +-- 19 files changed, 164 insertions(+), 57 deletions(-) delete mode 100644 app/assets/images/marker-blue.png create mode 100644 app/assets/images/marker-blue.svg create mode 100644 app/assets/images/marker-from.svg delete mode 100644 app/assets/images/marker-green.png create mode 100644 app/assets/images/marker-green.svg delete mode 100644 app/assets/images/marker-red.png create mode 100644 app/assets/images/marker-red.svg create mode 100644 app/assets/images/marker-to.svg 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 98b6726162ba31b42c8a827fc73cf66a054176da..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1519 zcmVP001cn1^@s6z>|W`000HHNkl@-W`!wgoxjDfKNDCBNF6E-! zT2K_lIp+}Mjv!MM$AI;mwkI<&Sw>>Agt$*6ZbI?DrzcP;z0lg^m&1AA_j&&3J*O=d zNQwr$@evU(^CbcR>!QMbcl^jnGE5L#b_de(5ng1;AZYAwq9fbghba4<@gZ_DpHlY# znXNPU{2J%raJvz^n08T>3@6u&tR?)Mta=>OQw=`k z>}{*;#L9a(*v28Tp0Pt?bPG(7Y41a#=tXATT{`w4p59RzP1F25HMXls*BSX5>iZAz z5kwSpTaE8(oZ)woaGtT*(_*H#=Ma$77j*d&%l=jl@pTNOtMFr*ySO#|7o5FjpUoq#xEK5MCL}i+9cp)I$3eYS zg7ExX!boKw_O?)REn~Bz-iY)@0}j@WI1PCD@+GfkfSzI11MFE-pVCCZb(5g}odQu_ zr!=Z~0K4@ZqH7qNv}Ss!)e}&5&bSP)SS%Rho+7$r$e~`=U_|n{DNz4Wf#}T7k=C7L z=r}}a8Jm;_3eip=|HhQdfW^f{3^22ZQ4KrPC)JyfR67ak-%BAkH;D_nu&bHFwkpOZ zu7*Ww1B(=O9~LZ2b|FhkOITP~;N@L^gv6=|q&AxE>gghB{2{2nP7o&l$%o9RHkuHr zWg)I)Y|@(OK9`Q7y5DHG3)%r6aL+u8ZOVRrT}-uOZJc@x)H`1gcKU`@XF}y8O6L$> z&a9x_(0!$CN0*EsyKNjZf6n2*g+)Am`V0+&EF^h1;jB(v!SG|^f^JZ6p&&H(M=P16 zuopY)IfQ8#J2BNpeq37q5aP2v)*?jYcOj;946-`bS&eNy^&RFv@u4}_S4_lLPC|Ch zj8HXWN2Fnqbe?k%Q*Cls8%Ai3cF_asDP0cvVMV5-u%E7u!`4#fb@BC5%>=05sO?)g z z0@XhzK6W9&-(Fd319=`(X+p5dhz}KvM`Efti1PbEwO{bf?L*p~(M2f65M9Y(OChta zaJ31M>KRboEP2B*gEX6{4u z>+vOXAw>pkp{w7JL(fCbAf&_u8n=)w>xKjz)q6q}lskanVl&=8W#ErN@)6K@huZ*K z$X7Z~Y$Pv)N)z6bvk(@U5tw}iG#27vNVBJOfw^}Oq@)1(80fs02s{fp((EZ=z_E4& zD$EEtehqXkC7y-&A8GPNcfjc}(D9e$a}PtlZ1l!<|LhLXF>U$W;}CDP5`i}%{{u!z VXVI7O#Mb}-002ovPDHLkV1gaj)DQpw 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 f0e64e747fa04ea73fb837f4f141e255c35268a7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1462 zcmaiziBnTo6vm%YTcE~T1dF1MV#rDo2oRAiA&U?NLIMKf7MBvD0hFSpY7rf|VVY)}o^#MF?szJ5n$itvn+SRe#z$LEwiL8UtFuge1TOGddK=U;rIFfC3R7SDnJ53Jd}#(BKix0COQZ7@!4kn21I~ z!@zMc00$tTKoY>t%vIyiJ|&Cu4$!(T%(2D@Cg0GgMZV5f6H^N-gE68&vkd{ zVfX0aon8^0J^}+nXz&#o{GyHi>y3di_nC3`SsU)NH$LEOdcfOa3fXE36`R&>f4FYP z!|QdY5`n#j;-Q&igiN3KCe+E1|)Uxjpn9_BBJ2_KV^f~ zmv(cZzHxAHaB_BbS%JlqNF)lyixB|DWHQ-oUZ^lSI#w)|%48|2>FEbEa&mHx950xu zvt?RsZLLn%*xcOQ*4B38re5FK)6?Jo^q*HyZ^oe}CqI0!Km}*)mBJr~%jX71`wEhb z8wCr3o%Lf9!JFiY%~(g*H34(De8=bV@AUr3M~@A6DN5{2WKO_)ord9*NLb-ExWA>P z%NVdlS;m_h4jZ!2$4`ve#ts^uyL#8%eerrzZ>zbF;VIp($mS7S`v$+AgQPplzZzB` zH~yWaGzSGx7S}38>?!kTsYE5puxc+pBOJ~nB0tjnuogM$2)hM`<{NSbhDY8t;$U*&bhfXIcIE19VmK^$xZnwYN1dQUffq1k)F z)!vwF>%w{Cp?O-qBxVO~-n9YOxuWv*L%6LjFHIF2 + + + + + + + + + + + + + + + + + + + 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 5ea2a6cc4174c43df080773d46cfa11f1ceee781..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1462 zcmaiziB}V66vaoWEl^`Ef<;k}VwhyIFOX6|1A!ExLLeX_Y713?R3J*xT5Azga$HVp z5Rrgb5ZS>*F#%)~3L5lCf?=tw;?i1d1+>Vb1k=|ue?Z@v%yQrTe(&ZxGpB-s{0X)z zZ4m?^hywg1a9sgE%-RahGl5BF1X*}CcuSZNjmbh|RixN#QXCvPBztJ9 z+!QVMn9en|+BLPt^*9{07K9Dqf+Y_ zj2sljTW}BEOcxhec!f#@4=8yg(pe%A2pTFCT0j61x*(Qd7>EE#U%wt8pqF77pkN{> z(1k(ZhZY_KTEK)Pzyvcs6v$uz9Xx;n5gyMGiMRrTzzH;X#52HLNDc;Q0URdck?=6E z91Oq#2q=&Qupq)e!ta3wC?G&K&>;*sfeiP+0W+NO9RM5T#3R9Sut67A0jCJV01l&J zVI_qEN$`EZH(5ug*U;&Bss;w5k;%NtWVWzazp_|uEY>YHThC_SVYBaYIQKZ54lcLD z&CS5$8Qk3s9v((dPveFSoqT?$w|A#NaNpPWzEEiL_csLum^N+d+Pt|dFtA%J?hX#_ zmPmR+LwmMv?F|p_jfm)tjO^RHw?8g!P$nBWc5Fm0f22^178X9QsQCNp)fZarL~HA0 zXXn(wz})z_d2-S`H8npyJwH49Zf@?~{QT1WV~gM&O;45tg~IiJ$_lUdZ5Bg)WM^mR z;OOYIj!2?VD0DiP=LN;*^92H7KuB2FwkWAIK3l++={O4a#W0O$R({J9Gp?p#fNa4fr6Z!dsxr-BwJH*R;9QCha z#bb%3yNLGApL;Fx6WKpie4_VEJb7xQTUlUZqWXHh)~R_8apZL_!-pCgx{Y36WEKl& zN47jPb0*KcvfegqcBqwbWN>+eFNXCC2FUFJqclRrX5= zNP3>EIbC&q>ZL(7w!4=_*vM zkxHZav_o$)YKY2iew$75B*eW zxH2lF? + + + + + + + + + + + + + + + + + + + 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" %>