Changeset 29365 in osm for applications/editors/josm/plugins/mirrored_download/src
- Timestamp:
- 2013-03-15T18:42:29+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mirrored_download/src/mirrored_download/MirroredDownloadAction.java
r28912 r29365 7 7 import java.awt.Component; 8 8 import java.awt.GridBagConstraints; 9 10 9 import java.awt.event.ActionEvent; 11 10 import java.awt.event.KeyEvent; 11 import java.io.UnsupportedEncodingException; 12 import java.net.URLEncoder; 12 13 import java.util.LinkedList; 13 14 import java.util.concurrent.Future; … … 160 161 @Override 161 162 protected String getRequestForBbox(double lon1, double lat1, double lon2, double lat2) { 162 return overpassQuery.isEmpty() && "*".equals(overpassType) 163 ? super.getRequestForBbox(lon1, lat1, lon2, lat2) 164 : overpassType + "[bbox=" + lon1 + "," + lat1 + "," + lon2 + "," + lat2 + "]" 165 + (MirroredDownloadPlugin.getAddMeta() ? "[@meta]" : "") + overpassQuery; 163 if (overpassQuery.isEmpty() && "*".equals(overpassType)) 164 return super.getRequestForBbox(lon1, lat1, lon2, lat2); 165 else 166 { 167 if (MirroredDownloadPlugin.getAddMeta()) 168 { 169 // Overpass compatibility layer 170 String url = overpassType + "[bbox=" + lon1 + "," + lat1 + "," + lon2 + "," + lat2 + "]" 171 + "[@meta]" + overpassQuery; 172 try 173 { 174 url = URLEncoder.encode(url, "UTF-8"); 175 } 176 catch (UnsupportedEncodingException e) 177 { 178 } 179 return url; 180 } 181 else 182 // Old style XAPI 183 return overpassType + "[bbox=" + lon1 + "," + lat1 + "," + lon2 + "," + lat2 + "]" 184 + overpassQuery; 185 } 166 186 } 167 187
Note:
See TracChangeset
for help on using the changeset viewer.