Changeset 3047 in josm for trunk


Ignore:
Timestamp:
2010-02-26T20:13:59+01:00 (14 years ago)
Author:
bastiK
Message:

fixed #4620 - Error: NaN in greatCircleDistance

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java

    r3010 r3047  
    147147                dataSet.dataSources.add(new DataSource(currentBounds, "OpenStreetMap server"));
    148148            }
     149
    149150            rememberDownloadedData(dataSet);
    150151            int numDataLayers = getNumDataLayers();
     
    154155                //
    155156                OsmDataLayer layer = new OsmDataLayer(dataSet, OsmDataLayer.createNewName(), null);
     157                final boolean isDisplayingMapView = Main.isDisplayingMapView();
     158               
    156159                Main.main.addLayer(layer);
    157                 BoundingXYVisitor v = new BoundingXYVisitor();
    158                 v.visit(currentBounds);
    159                 Main.map.mapView.recalculateCenterScale(v);
     160
     161                // If the mapView is not there yet, we cannot calculate the bounds (see constructor of MapView).
     162                // Otherwise jump to the current download.
     163                if (isDisplayingMapView) {
     164                    System.err.println("TRUE!");
     165                    BoundingXYVisitor v = new BoundingXYVisitor();
     166                    v.visit(currentBounds);
     167                    Main.map.mapView.recalculateCenterScale(v);
     168                }
    160169            } else {
    161170                OsmDataLayer target;
Note: See TracChangeset for help on using the changeset viewer.