]> git.openstreetmap.org Git - rails.git/commitdiff
Use stored lats/lons to draw trace images
authorAnton Khorev <tony29@yandex.ru>
Mon, 23 Sep 2024 13:34:24 +0000 (16:34 +0300)
committerAnton Khorev <tony29@yandex.ru>
Wed, 25 Sep 2024 21:28:39 +0000 (00:28 +0300)
lib/gpx.rb

index bae975b61a91d9d49190abac1d9c6ca842158681..021971c363a8aaa37a50eaa26fd32b92fc0a512d 100644 (file)
@@ -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