Ticket #1859: trackpoint_properly.diff

File trackpoint_properly.diff, 1.0 KB (added by ploppy, 10 years ago)

Patch

  • app/models/tracepoint.rb

     
    1515    el1 = XML::Node.new 'trkpt'
    1616    el1['lat'] = self.lat.to_s
    1717    el1['lon'] = self.lon.to_s
     18    el1 << XML::Node.new('time', self.timestamp.xmlschema)
    1819    return el1
    1920  end
    2021end
  • app/controllers/api_controller.rb

     
    4343    end
    4444
    4545    # get all the points
    46     points = Tracepoint.find_by_area(min_lat, min_lon, max_lat, max_lon, :offset => offset, :limit => APP_CONFIG['tracepoints_per_page'], :order => "timestamp DESC" )
     46    points = Tracepoint.find_by_area(min_lat, min_lon, max_lat, max_lon, :offset => offset, :limit => APP_CONFIG['tracepoints_per_page'], :order => "timestamp ASC" )
    4747
    4848    doc = XML::Document.new
    4949    doc.encoding = XML::Encoding::UTF_8