From: Anton Khorev Date: Mon, 23 Sep 2024 13:34:24 +0000 (+0300) Subject: Use stored lats/lons to draw trace images X-Git-Tag: live~148^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/6c6d306de97678515b3f3ed8ca4e56fd68a5d46b?ds=sidebyside;hp=-c Use stored lats/lons to draw trace images --- 6c6d306de97678515b3f3ed8ca4e56fd68a5d46b diff --git a/lib/gpx.rb b/lib/gpx.rb index bae975b61..021971c36 100644 --- a/lib/gpx.rb +++ b/lib/gpx.rb @@ -98,9 +98,9 @@ module GPX first = true - points.each_with_index do |p, pt| - px = proj.x(p.longitude) - py = proj.y(p.latitude) + @actual_points.times do |pt| + px = proj.x @lons[pt] + py = proj.y @lats[pt] if (pt >= (points_per_frame * n)) && (pt <= (points_per_frame * (n + 1))) pen.thickness = 3 @@ -155,9 +155,9 @@ module GPX first = true - points do |p| - px = proj.x(p.longitude) - py = proj.y(p.latitude) + @actual_points.times do |pt| + px = proj.x @lons[pt] + py = proj.y @lats[pt] pen.line(px, py, oldpx, oldpy) unless first