summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-01-05 11:09:08 +0100
committerDaniel Friesel <derf@finalrewind.org>2020-01-05 11:09:08 +0100
commit06e65334b39b210c367256d128df5de9e1b29425 (patch)
tree1c77e0c3e416e4b62c6c4baaa776c399c54fe0ef /templates
parent7e825ba8a3480773e42823756355ff5e2367586c (diff)
map: show arr/dep times2.5.3
Diffstat (limited to 'templates')
-rw-r--r--templates/route_map.html.ep11
1 files changed, 8 insertions, 3 deletions
diff --git a/templates/route_map.html.ep b/templates/route_map.html.ep
index 215444f..4ba5917 100644
--- a/templates/route_map.html.ep
+++ b/templates/route_map.html.ep
@@ -1,4 +1,9 @@
- <div class="container">
+<div class="container" style="margin-top: 1ex; margin-bottom: 1ex;">
+Fahrt von <strong><%= $origin->{name} %></strong>
+nach <strong><%= $destination->{name} %></strong>
+</div>
+
+<div class="container">
<div id="map" style="height: 500px;">
</div>
</div>
@@ -11,7 +16,7 @@ L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
}).addTo(map);
var stations = [
% for my $station ( @{stash('station_coordinates') // [] } ) {
-[[<%= $station->[0][0] %>,<%= $station->[0][1] %>],'<%= $station->[1] %>'],
+[[<%= $station->[0][0] %>,<%= $station->[0][1] %>],['<%== join("','", map { Mojo::Util::xml_escape($_) } @{$station->[1]}) %>']],
% }
];
@@ -38,7 +43,7 @@ for (var station_id in stations) {
fillColor: '#f03',
fillOpacity: 0.5,
radius: 250
- }).bindPopup(stations[station_id][1]).addTo(map);
+ }).bindPopup(stations[station_id][1].join('<br/>')).addTo(map);
}
</script>