Changeset 35188 in osm for applications/editors/josm/plugins
- Timestamp:
- 2019-10-12T23:34:58+02:00 (5 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/download
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/download/CadastreDownloadSource.java
r34355 r35188 24 24 public void doDownload(CadastreDownloadData data, DownloadSettings settings) { 25 25 if (settings.getDownloadBounds().isPresent()) { 26 new CadastreDownloadTask(data ).download(26 new CadastreDownloadTask(data, settings.zoomToData()).download( 27 27 new DownloadParams().withUploadPolicy(UploadPolicy.BLOCKED).withNewLayer(settings.asNewLayer()), 28 28 settings.getDownloadBounds().get(), null); -
applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/download/CadastreDownloadTask.java
r34801 r35188 43 43 */ 44 44 public CadastreDownloadTask() { 45 this(new CadastreDownloadData(true, true, true, true, true, true, true, true, true) );45 this(new CadastreDownloadData(true, true, true, true, true, true, true, true, true), true); 46 46 } 47 47 … … 49 49 * Constructs a new {@code CadastreDownloadTask} with parameterizable behaviour. 50 50 * @param data defines which data has to be downloaded 51 * @param zoomToData if true, the map view will zoom to download area after download 51 52 */ 52 public CadastreDownloadTask(CadastreDownloadData data ) {53 public CadastreDownloadTask(CadastreDownloadData data, boolean zoomToData) { 53 54 this.data = Objects.requireNonNull(data); 55 setZoomAfterDownload(zoomToData); 54 56 } 55 57 … … 60 62 for (String id : CadastreAPI.getSheets(downloadArea)) { 61 63 String url = String.join("/", CADASTRE_URL, id.substring(0, 2), id.substring(0, 5), "edigeo-"+id+".tar.bz2"); 62 tasks.add(MainApplication.worker.submit(new InternalDownloadTask(settings, url, progressMonitor )));64 tasks.add(MainApplication.worker.submit(new InternalDownloadTask(settings, url, progressMonitor, zoomAfterDownload))); 63 65 } 64 66 } catch (IOException e) { … … 80 82 @Override 81 83 public Future<?> loadUrl(DownloadParams settings, String url, ProgressMonitor progressMonitor) { 82 downloadTask = new InternalDownloadTask(settings, url, progressMonitor );84 downloadTask = new InternalDownloadTask(settings, url, progressMonitor, zoomAfterDownload); 83 85 currentBounds = null; 84 86 return MainApplication.worker.submit(downloadTask); … … 106 108 private final String url; 107 109 108 InternalDownloadTask(DownloadParams settings, String url, ProgressMonitor progressMonitor ) {109 super(settings, new CadastreServerReader(url, data), progressMonitor );110 InternalDownloadTask(DownloadParams settings, String url, ProgressMonitor progressMonitor, boolean zoom) { 111 super(settings, new CadastreServerReader(url, data), progressMonitor, zoom); 110 112 this.url = url; 111 113 }
Note:
See TracChangeset
for help on using the changeset viewer.