- Timestamp:
- 2013-11-01T21:32:02+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
r6332 r6350 30 30 31 31 /** 32 * Handler for load_and_zoom request. 32 * Handler for {@code load_and_zoom} and {@code zoom} requests. 33 * @since 3707 33 34 */ 34 public class LoadAndZoomHandler extends RequestHandler 35 { 35 public class LoadAndZoomHandler extends RequestHandler { 36 36 37 /** 37 38 * The remote control command name used to load data and zoom. … … 56 57 57 58 @Override 58 public String getPermissionMessage() 59 { 59 public String getPermissionMessage() { 60 60 String msg = tr("Remote Control has been asked to load data from the API.") + 61 61 "<br>" + tr("Bounding box: ") + new BBox(minlon, minlat, maxlon, maxlat).toStringCSV(", "); … … 67 67 68 68 @Override 69 public String[] getMandatoryParams() 70 { 69 public String[] getMandatoryParams() { 71 70 return new String[] { "bottom", "top", "left", "right" }; 72 71 } 73 72 74 73 @Override 75 public String[] getOptionalParams() 76 { 74 public String[] getOptionalParams() { 77 75 return new String[] {"new_layer", "addtags", "select", "zoom_mode"}; 78 76 } … … 96 94 97 95 @Override 98 protected void handleRequest() throws RequestHandlerErrorException 99 { 96 protected void handleRequest() throws RequestHandlerErrorException { 100 97 DownloadTask osmTask = new DownloadOsmTask(); 101 98 try { … … 241 238 } catch (NumberFormatException e) { 242 239 throw new RequestHandlerBadRequestException("NumberFormatException ("+e.getMessage()+")"); 240 } 241 242 // Current API 0.6 check: "The latitudes must be between -90 and 90" 243 if (!LatLon.isValidLat(minlat) || !LatLon.isValidLat(maxlat)) { 244 throw new RequestHandlerBadRequestException(tr("The latitudes must be between {0} and {1}", -90d, 90d)); 245 } 246 // Current API 0.6 check: "longitudes between -180 and 180" 247 if (!LatLon.isValidLon(minlon) || !LatLon.isValidLon(maxlon)) { 248 throw new RequestHandlerBadRequestException(tr("The longitudes must be between {0} and {1}", -180d, 180d)); 249 } 250 // Current API 0.6 check: "the minima must be less than the maxima" 251 if (minlat > maxlat || minlon > maxlon) { 252 throw new RequestHandlerBadRequestException(tr("The minima must be less than the maxima")); 243 253 } 244 254
Note:
See TracChangeset
for help on using the changeset viewer.