Ticket #2030: JOSM links.patch

File JOSM links.patch, 906 bytes (added by bruce89, 17 years ago)

patch

  • src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java

     
    164162            size *= 2;
    165163            zoom++;
    166164        }
    167         showUrl.setText("http://www.openstreetmap.org/index.html?mlat="+lat+"&mlon="+lon+"&zoom="+zoom);
     165        // Truncate lat and lon to something more sensible
     166        int decimals = (int) Math.pow(10, (zoom / 3));
     167        lat = Math.round(lat * decimals);
     168        lat /= decimals;
     169        lon = Math.round(lon * decimals);
     170        lon /= decimals;
     171        showUrl.setText("http://www.openstreetmap.org/?lat="+lat+"&lon="+lon+"&zoom="+zoom);
    168172    }
    169173
    170174    public static Bounds osmurl2bounds(String url) {