Changeset 14761 in josm for trunk/src/org
- Timestamp:
- 2019-02-05T10:53:02+01:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java
r13927 r14761 16 16 import org.openstreetmap.josm.data.Bounds.ParseMethod; 17 17 import org.openstreetmap.josm.data.ProjectionBounds; 18 import org.openstreetmap.josm.data.ViewportData;19 18 import org.openstreetmap.josm.data.gpx.GpxData; 20 19 import org.openstreetmap.josm.gui.MainApplication; 21 import org.openstreetmap.josm.gui.MapFrame;22 20 import org.openstreetmap.josm.gui.PleaseWaitRunnable; 23 21 import org.openstreetmap.josm.gui.io.importexport.GpxImporter; … … 161 159 mergeLayer.mergeFrom(layer); 162 160 mergeLayer.invalidate(); 163 MapFrame map = MainApplication.getMap();164 if (map != null && zoomAfterDownload && layer instanceof GpxLayer) {165 map.mapView.scheduleZoomTo(new ViewportData(layer.getViewProjectionBounds()));166 }167 161 return mergeLayer; 168 162 } -
trunk/src/org/openstreetmap/josm/gui/io/importexport/GpxImporter.java
r12854 r14761 145 145 GpxLayer gpxLayer = null; 146 146 MarkerLayer markerLayer = null; 147 if (data.hasRoutePoints() || data.hasTrackPoints()) { 148 gpxLayer = new GpxLayer(data, gpxLayerName, data.storageFile != null); 149 } 147 gpxLayer = new GpxLayer(data, gpxLayerName, data.storageFile != null); 150 148 if (Config.getPref().getBoolean("marker.makeautomarkers", true) && !data.waypoints.isEmpty()) { 151 149 markerLayer = new MarkerLayer(data, markerLayerName, data.storageFile, gpxLayer); -
trunk/src/org/openstreetmap/josm/io/BoundingBoxDownloader.java
r12620 r14761 51 51 boolean done = false; 52 52 GpxData result = null; 53 final int pointsPerPage = 5000; // see https://wiki.openstreetmap.org/wiki/API_v0.6#GPS_traces 53 54 String url = "trackpoints?bbox="+b.getMinLon()+','+b.getMinLat()+','+b.getMaxLon()+','+b.getMaxLat()+"&page="; 54 55 for (int i = 0; !done && !isCanceled(); ++i) { 55 progressMonitor.subTask(tr("Downloading points {0} to {1}...", i * 5000, (i + 1) * 5000));56 progressMonitor.subTask(tr("Downloading points {0} to {1}...", i * pointsPerPage, (i + 1) * pointsPerPage)); 56 57 try (InputStream in = getInputStream(url+i, progressMonitor.createSubTaskMonitor(1, true))) { 57 58 if (in == null) { … … 65 66 result = currentGpx; 66 67 } else if (currentGpx.hasTrackPoints()) { 68 long count = currentGpx.getTrackPoints().count(); 69 Logging.debug("got {0} gpx points", count); 70 if (count < pointsPerPage) 71 done = true; 67 72 result.mergeFrom(currentGpx); 68 73 } else {
Note:
See TracChangeset
for help on using the changeset viewer.