summaryrefslogtreecommitdiff
path: root/templates/route_map.html.ep
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-01-08 21:27:32 +0100
committerDaniel Friesel <derf@finalrewind.org>2020-01-08 21:27:32 +0100
commit240976e8056624ee93f858829b75e33993561c24 (patch)
treefd032ce45ef20187be2ee5023b0aa965365e8102 /templates/route_map.html.ep
parent8af56f340b6af2684fe4365bc33b478e56654a2b (diff)
show station location in map2.5.9
Diffstat (limited to 'templates/route_map.html.ep')
-rw-r--r--templates/route_map.html.ep25
1 files changed, 24 insertions, 1 deletions
diff --git a/templates/route_map.html.ep b/templates/route_map.html.ep
index 6fc4201..8cdf630 100644
--- a/templates/route_map.html.ep
+++ b/templates/route_map.html.ep
@@ -98,9 +98,32 @@ for (var station_id in stations) {
}).bindPopup(stations[station_id][1].join('<br/>')).addTo(map);
}
+var greenIcon = new L.Icon({
+ iconUrl: '/static/leaflet/images/marker-icon-2x-green.png',
+ shadowUrl: '/static/leaflet/images/marker-shadow.png',
+ iconSize: [25, 41],
+ iconAnchor: [12, 41],
+ popupAnchor: [1, -34],
+ shadowSize: [41, 41]
+});
+
+var goldIcon = new L.Icon({
+ iconUrl: '/static/leaflet/images/marker-icon-2x-gold.png',
+ shadowUrl: '/static/leaflet/images/marker-shadow.png',
+ iconSize: [25, 41],
+ iconAnchor: [12, 41],
+ popupAnchor: [1, -34],
+ shadowSize: [41, 41]
+});
+
var marker;
% for my $marker (@{stash('markers') // [] } ) {
- marker = L.marker([<%= $marker->{lat} %>,<%= $marker->{lon} %>]).addTo(map);
+ % if ($marker->{icon}) {
+ marker = L.marker([<%= $marker->{lat} %>,<%= $marker->{lon} %>], {icon: <%= $marker->{icon} %>}).addTo(map);
+ % }
+ % else {
+ marker = L.marker([<%= $marker->{lat} %>,<%= $marker->{lon} %>]).addTo(map);
+ % }
% if ($marker->{title}) {
marker.bindPopup('<%= $marker->{title} %>');
% }