Changeset 33722 in osm


Ignore:
Timestamp:
2017-10-19T00:32:43+02:00 (7 years ago)
Author:
donvip
Message:

fix #josm15438 - Wrong units for measuring speeds

Location:
applications/editors/josm/plugins/infomode/src/org/openstreetmap/josm/plugins/infomode
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/infomode/src/org/openstreetmap/josm/plugins/infomode/InfoMode.java

    r33720 r33722  
    290290                    if (prevWp != null && wp.time != prevWp.time) {
    291291                        vel = wp.getCoor().greatCircleDistance(prevWp.getCoor())/
    292                                 (wp.time-prevWp.time)*3.6;
     292                                (wp.time-prevWp.time);
    293293                    }
    294294                    infoPanel.setData(wp, trk, vel, gpxL.data.tracks);
  • applications/editors/josm/plugins/infomode/src/org/openstreetmap/josm/plugins/infomode/InfoPanel.java

    r33721 r33722  
    1919import javax.swing.JPanel;
    2020
     21import org.openstreetmap.josm.data.SystemOfMeasurement;
    2122import org.openstreetmap.josm.data.gpx.GpxTrack;
    2223import org.openstreetmap.josm.data.gpx.GpxTrackSegment;
     
    111112            but2.setVisible(true);
    112113        }
    113         if (vel > 0) label2.setText(String.format("%.1f "+tr("km/h"), vel));
    114         else label2.setText(null);
     114        if (vel > 0) {
     115            SystemOfMeasurement som = SystemOfMeasurement.getSystemOfMeasurement();
     116            label2.setText(String.format("%.1f "+som.speedName, vel * som.speedValue));
     117        } else {
     118            label2.setText(null);
     119        }
    115120        String s = (String) trk.getAttributes().get("name");
    116121        if (s != null)
Note: See TracChangeset for help on using the changeset viewer.