Changeset 14505 in josm for trunk/src/org


Ignore:
Timestamp:
2018-12-03T20:43:27+01:00 (5 years ago)
Author:
Don-vip
Message:

see #17061 - more helpful exception

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/imagery/TileCoordinateConverter.java

    r14273 r14505  
    2222import org.openstreetmap.josm.gui.MapView;
    2323import org.openstreetmap.josm.gui.MapViewState.MapViewPoint;
     24import org.openstreetmap.josm.tools.JosmRuntimeException;
     25import org.openstreetmap.josm.tools.bugreport.BugReport;
    2426
    2527/**
     
    8082     */
    8183    public Point2D getPixelForTile(int x, int y, int zoom) {
    82         ICoordinate coord = tileSource.tileXYToLatLon(x, y, zoom);
    83         return pos(coord).getInView();
     84        try {
     85            ICoordinate coord = tileSource.tileXYToLatLon(x, y, zoom);
     86            if (Double.isNaN(coord.getLat()) || Double.isNaN(coord.getLon())) {
     87                throw new JosmRuntimeException("tileXYToLatLon returned " + coord);
     88            }
     89            return pos(coord).getInView();
     90        } catch (RuntimeException e) {
     91            throw BugReport.intercept(e).put("tileSource", tileSource).put("x", x).put("y", y).put("zoom", zoom);
     92        }
    8493    }
    8594
Note: See TracChangeset for help on using the changeset viewer.