2019-11-15 23:01:50 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col s12">
|
|
|
|
<div id="map" style="height: 500px;">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-11-16 14:57:09 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col s12">
|
|
|
|
<span style="color: #f03;">●</span> Ein-/Ausstiegsstation<br/>
|
2020-01-31 17:16:00 +00:00
|
|
|
<span style="color: #673ab7;">—</span> Streckenverlauf oder Luftlinie
|
2019-11-16 14:57:09 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2019-11-15 23:01:50 +00:00
|
|
|
<script>
|
|
|
|
var map = L.map('map').setView([51.306, 9.712], 6);
|
|
|
|
|
|
|
|
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
|
|
|
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
|
|
|
}).addTo(map);
|
|
|
|
|
|
|
|
var stations = [
|
|
|
|
% for my $station ( @{stash('station_coordinates') // [] } ) {
|
2019-11-16 13:50:07 +00:00
|
|
|
[[<%= $station->[0][0] %>,<%= $station->[0][1] %>],'<%= $station->[1] %>'],
|
2019-11-15 23:01:50 +00:00
|
|
|
% }
|
|
|
|
];
|
|
|
|
|
2020-01-25 13:41:33 +00:00
|
|
|
var routes = [];
|
|
|
|
var pl;
|
|
|
|
% for my $line_group ( @{ stash('polyline_groups') // [] } ) {
|
2020-02-07 22:19:01 +00:00
|
|
|
routes = [ <%= $line_group->{polylines} %> ];
|
2020-01-25 13:41:33 +00:00
|
|
|
pl = L.polyline(routes, {color: '<%= $line_group->{color} %>', opacity: <%= $line_group->{opacity} %>}).addTo(map);
|
|
|
|
% if ($line_group->{fit_bounds}) {
|
|
|
|
if (routes.length) {
|
|
|
|
map.fitBounds(pl.getBounds());
|
|
|
|
}
|
|
|
|
% }
|
2019-11-15 23:01:50 +00:00
|
|
|
% }
|
2019-12-28 21:21:17 +00:00
|
|
|
|
2020-01-29 17:48:58 +00:00
|
|
|
% if (my $b = stash('bounds')) {
|
|
|
|
map.fitBounds([[<%= $b->[0][0] %>,<%= $b->[0][1] %>],[<%= $b->[1][0] %>,<%= $b->[1][1] %>]]);
|
|
|
|
% }
|
|
|
|
|
2019-11-15 23:01:50 +00:00
|
|
|
for (var station_id in stations) {
|
2019-11-16 13:50:07 +00:00
|
|
|
L.circle(stations[station_id][0], {
|
2019-11-15 23:01:50 +00:00
|
|
|
color: '#f03',
|
2019-12-28 21:21:17 +00:00
|
|
|
opacity: 0.7,
|
2019-11-15 23:01:50 +00:00
|
|
|
fillColor: '#f03',
|
|
|
|
fillOpacity: 0.5,
|
2019-11-16 13:50:07 +00:00
|
|
|
radius: 250
|
|
|
|
}).bindPopup(stations[station_id][1]).addTo(map);
|
2019-11-15 23:01:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|