- Timestamp:
- 2013-12-23T10:05:58+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/OsmUrlToBounds.java
r6474 r6514 88 88 * @param url string for parsing 89 89 * @return Bounds if hashurl, {@code null} otherwise 90 * @throws IllegalArgumentException if URL is invalid91 90 */ 92 91 private static Bounds parseHashURLs(String url) throws IllegalArgumentException { … … 98 97 String[] parts = coordPart.split("/"); 99 98 if (parts.length < 3) { 100 throw new IllegalArgumentException(tr("URL does not contain {0}/{1}/{2}", tr("zoom"), tr("latitude"), tr("longitude"))); 99 Main.warn(tr("URL does not contain {0}/{1}/{2}", tr("zoom"), tr("latitude"), tr("longitude"))); 100 return null; 101 101 } 102 102 int zoom; … … 105 105 zoom = Integer.parseInt(parts[0]); 106 106 } catch (NumberFormatException e) { 107 throw new IllegalArgumentException(tr("URL does not contain valid {0}", tr("zoom")), e); 107 Main.warn(tr("URL does not contain valid {0}", tr("zoom")), e); 108 return null; 108 109 } 109 110 try { 110 111 lat = Double.parseDouble(parts[1]); 111 112 } catch (NumberFormatException e) { 112 throw new IllegalArgumentException(tr("URL does not contain valid {0}", tr("latitude")), e); 113 Main.warn(tr("URL does not contain valid {0}", tr("latitude")), e); 114 return null; 113 115 } 114 116 try { 115 117 lon = Double.parseDouble(parts[2]); 116 118 } catch (NumberFormatException e) { 117 throw new IllegalArgumentException(tr("URL does not contain valid {0}", tr("longitude")), e); 119 Main.warn(tr("URL does not contain valid {0}", tr("longitude")), e); 120 return null; 118 121 } 119 122 return positionToBounds(lat, lon, zoom);
Note:
See TracChangeset
for help on using the changeset viewer.