diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/_train_details.html.ep | 2 | ||||
-rw-r--r-- | templates/route_map.html.ep | 25 |
2 files changed, 25 insertions, 2 deletions
diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep index 0ace74c..4a4738d 100644 --- a/templates/_train_details.html.ep +++ b/templates/_train_details.html.ep @@ -85,7 +85,7 @@ % } % if ($departure->{trip_id}) { <div class="verbose"> - <a href="/map/<%= $departure->{trip_id} %>/<%= $departure->{train_line} // 0 %>">Karte</a> + <a href="/map/<%= $departure->{trip_id} %>/<%= $departure->{train_line} // 0 %>?from=<%= $station_name %>">Karte</a> </div> % } 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} %>'); % } |