summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-02-07 23:19:01 +0100
committerDaniel Friesel <derf@finalrewind.org>2020-02-07 23:19:01 +0100
commit3ddd1a1cf47feb7c037db60555b4287e5a684a08 (patch)
tree10be5fae8d14cf7daa466d852eafae3d73e2f2d7 /templates
parentc2e0f377be954b70c1c095e441871231c603a34d (diff)
Improve map performance by passing actual polylines for train routes1.14.7
Diffstat (limited to 'templates')
-rw-r--r--templates/_map.html.ep6
1 files changed, 1 insertions, 5 deletions
diff --git a/templates/_map.html.ep b/templates/_map.html.ep
index 2e6dad8..19ea617 100644
--- a/templates/_map.html.ep
+++ b/templates/_map.html.ep
@@ -28,11 +28,7 @@ var stations = [
var routes = [];
var pl;
% for my $line_group ( @{ stash('polyline_groups') // [] } ) {
- routes = [
- % for my $pair ( @{$line_group->{polylines} // []} ) {
- [[<%= $pair->[0][0] %>,<%= $pair->[0][1] %>],[<%= $pair->[1][0] %>,<%= $pair->[1][1] %>]],
- % }
- ];
+ routes = [ <%= $line_group->{polylines} %> ];
pl = L.polyline(routes, {color: '<%= $line_group->{color} %>', opacity: <%= $line_group->{opacity} %>}).addTo(map);
% if ($line_group->{fit_bounds}) {
if (routes.length) {