summaryrefslogtreecommitdiff
path: root/templates/_map.html.ep
diff options
context:
space:
mode:
Diffstat (limited to 'templates/_map.html.ep')
-rw-r--r--templates/_map.html.ep33
1 files changed, 22 insertions, 11 deletions
diff --git a/templates/_map.html.ep b/templates/_map.html.ep
index daa16f0..93f116a 100644
--- a/templates/_map.html.ep
+++ b/templates/_map.html.ep
@@ -1,16 +1,18 @@
-<div class="row">
- <div class="col s12">
- <div id="map" style="height: 70vh;">
+% if (stash('with_map_header') // 1) {
+ <div class="row">
+ <div class="col s12">
+ <div id="map" style="height: 70vh;">
+ </div>
</div>
</div>
-</div>
-<div class="row">
- <div class="col s12">
- <span style="color: #f03;">●</span> Ein-/Ausstiegsstation<br/>
- <span style="color: #673ab7;">—</span> Streckenverlauf oder Luftlinie
+ <div class="row">
+ <div class="col s12">
+ <span style="color: #f03;">●</span> Ein-/Ausstiegsstation<br/>
+ <span style="color: #673ab7;">—</span> Streckenverlauf oder Luftlinie
+ </div>
</div>
-</div>
+% }
<script>
var map = L.map('map').setView([51.306, 9.712], 6);
@@ -37,6 +39,15 @@ var pl;
% }
% }
+% for my $marker (@{stash('markers') // []}) {
+ % if ($marker->[0] and $marker->[0][0] and $marker->[1]) {
+ {
+ const marker = L.marker([<%= $marker->[0][0] %>, <%= $marker->[0][1] %>]).addTo(map);
+ marker.bindPopup('<%= $marker->[1] %>');
+ }
+ % }
+% }
+
% if (my $b = stash('bounds')) {
map.fitBounds([[<%= $b->[0][0] %>,<%= $b->[0][1] %>],[<%= $b->[1][0] %>,<%= $b->[1][1] %>]]);
% }
@@ -46,8 +57,8 @@ for (var station_id in stations) {
color: '#f03',
opacity: 0.7,
fillColor: '#f03',
- fillOpacity: 0.5,
- radius: 250
+ fillOpacity: 0.2,
+ radius: 200
}).bindPopup(stations[station_id][1]).addTo(map);
}