Ignore:
Timestamp:
2009-09-12T18:22:41+02:00 (15 years ago)
Author:
Gubaer
Message:

applied #3222: patch by sbrunner: better HDOP visualisation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java

    r2025 r2105  
    440440        // paint large dots for points
    441441        boolean large = Main.pref.getBoolean("draw.rawgps.large");
     442        boolean hdopcircle = Main.pref.getBoolean("draw.rawgps.hdopcircle", true);
    442443        // color the lines
    443444        colorModes colored = colorModes.none;
     
    632633        } // end if lines
    633634
     635
    634636        /****************************************************************
    635          ********** STEP 3d - DRAW LARGE POINTS *************************
     637         ********** STEP 3d - DRAW LARGE POINTS AND HDOP CIRCLE *********
    636638         ****************************************************************/
    637         if (large) {
     639        if (large || hdopcircle) {
    638640            g.setColor(neutralColor);
    639641            for (GpxTrack trk : data.tracks) {
     
    646648                        Point screen = mv.getPoint(trkPnt.getEastNorth());
    647649                        g.setColor(trkPnt.customColoring);
    648                         g.fillRect(screen.x - 1, screen.y - 1, 3, 3);
     650                        if (hdopcircle && trkPnt.attr.get("hdop") != null) {
     651                            // hdop value
     652                            float hdop = ((Float)trkPnt.attr.get("hdop")).floatValue();
     653                            if (hdop < 0) {
     654                                hdop = 0;
     655                            }
     656                            // hdop pixels
     657                            int hdopp = mv.getPoint(new LatLon(trkPnt.getCoor().lat(), trkPnt.getCoor().lon() + 2*6*hdop*360/40000000)).x - screen.x;
     658                            g.drawArc(screen.x-hdopp/2, screen.y-hdopp/2, hdopp, hdopp, 0, 360);
     659                        }
     660                        if (large) {
     661                            g.fillRect(screen.x-1, screen.y-1, 3, 3);
     662                        }
    649663                    } // end for trkpnt
    650664                } // end for segment
    651665            } // end for trk
    652         } // end if large
     666        } // end if large || hdopcircle
    653667
    654668        /****************************************************************
Note: See TracChangeset for help on using the changeset viewer.