Changeset 65 in josm for src


Ignore:
Timestamp:
2006-03-19T12:03:22+01:00 (18 years ago)
Author:
imi
Message:
  • Zoom via scroll wheel now to cursor, not to center of screen (thanks Ben K.)
  • fixed silly broken gpx download. Raw Gps data should work now.
Location:
src/org/openstreetmap/josm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/org/openstreetmap/josm/gui/MapMover.java

    r42 r65  
    109109        public void mouseWheelMoved(MouseWheelEvent e) {
    110110                double zoom = Math.max(0.1, 1 + e.getWheelRotation()/5.0);
    111                 nc.zoomTo(nc.getCenter(), nc.getScale()*zoom);
     111                double zoomfactor = (zoom -1)/2+1;
     112                int newHalfWidth = (int) (nc.getWidth()*zoomfactor - nc.getWidth()/2);
     113                int centerx = e.getX() - (e.getX()-nc.getWidth()/2)*newHalfWidth*2/nc.getWidth();
     114                int newHalfHeight = (int) (nc.getHeight()*zoomfactor - nc.getHeight()/2);
     115                int centery = e.getY() - (e.getY()-nc.getHeight()/2)*newHalfHeight*2/nc.getHeight();
     116                GeoPoint newCenter = nc.getPoint(centerx, centery, false);
     117                nc.zoomTo(newCenter, nc.getScale()*zoom);
    112118        }
    113119
  • src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r64 r65  
    149149                        return minPrimitive;
    150150               
    151                 // for whole waies, try the waies first
     151                // for whole ways, try the ways first
    152152                minDistanceSq = Double.MAX_VALUE;
    153153                if (!lsInsteadWay) {
    154                         for (Way t : Main.main.ds.waies) {
    155                                 if (t.isDeleted())
     154                        for (Way w : Main.main.ds.waies) {
     155                                if (w.isDeleted())
    156156                                        continue;
    157                                 for (LineSegment ls : t.segments) {
     157                                for (LineSegment ls : w.segments) {
    158158                                        if (ls.isDeleted())
    159159                                                continue;
     
    166166                                        if (perDist < 100 && minDistanceSq > perDist && a < c+100 && b < c+100) {
    167167                                                minDistanceSq = perDist;
    168                                                 minPrimitive = t;
     168                                                minPrimitive = w;
    169169                                        }
    170170                                }                       
  • src/org/openstreetmap/josm/io/OsmReader.java

    r64 r65  
    9696                                        LineSegment ls = lineSegments.get(getLong(atts, "id"));
    9797                                        if (ls == null)
    98                                                 fatalError(new SAXParseException("Line segment "+getLong(atts, "id")+"has not been transfered before.", null));
     98                                                fatalError(new SAXParseException("Line segment "+getLong(atts, "id")+" has not been transfered before.", null));
    9999                                        ((Way)current).segments.add(ls);
    100100                                }
  • src/org/openstreetmap/josm/io/OsmServerReader.java

    r64 r65  
    4848         */
    4949        public Collection<Collection<GeoPoint>> parseRawGps() throws IOException, JDOMException {
    50                 String url = Main.pref.osmDataServer+"/0.3/waypoints?bbox="+lon1+","+lat1+","+lon2+","+lat2+"&page=";
     50                String url = Main.pref.osmDataServer+"/0.3/trackpoints?bbox="+lon1+","+lat1+","+lon2+","+lat2+"&page=";
    5151                Collection<Collection<GeoPoint>> data = new LinkedList<Collection<GeoPoint>>();
    5252                Collection<GeoPoint> list = new LinkedList<GeoPoint>();
Note: See TracChangeset for help on using the changeset viewer.