From 3ddd1a1cf47feb7c037db60555b4287e5a684a08 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 7 Feb 2020 23:19:01 +0100 Subject: Improve map performance by passing actual polylines for train routes --- templates/_map.html.ep | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'templates/_map.html.ep') 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) { -- cgit v1.2.3