Ignore:
Timestamp:
2017-08-27T00:17:49+02:00 (7 years ago)
Author:
Don-vip
Message:

see #15182 - remove dependence on JMapViewer for package data.coor (only useful for imagery)

File:
1 edited

Legend:

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

    r11961 r12669  
    1717import org.openstreetmap.josm.data.coor.EastNorth;
    1818import org.openstreetmap.josm.data.coor.LatLon;
     19import org.openstreetmap.josm.data.imagery.CoordinateConversion;
    1920import org.openstreetmap.josm.data.projection.Projecting;
    2021import org.openstreetmap.josm.data.projection.ShiftedProjecting;
     
    4647
    4748    private MapViewPoint pos(ICoordinate ll) {
    48         return mapView.getState().getPointFor(new LatLon(ll)).add(settings.getDisplacement());
     49        return mapView.getState().getPointFor(CoordinateConversion.coorToLL(ll)).add(settings.getDisplacement());
    4950    }
    5051
    5152    private MapViewPoint pos(IProjected p) {
    52         return mapView.getState().getPointFor(new EastNorth(p)).add(settings.getDisplacement());
     53        return mapView.getState().getPointFor(CoordinateConversion.projToEn(p)).add(settings.getDisplacement());
    5354    }
    5455
     
    6061     */
    6162    public IProjected shiftDisplayToServer(EastNorth en) {
    62         return en.subtract(settings.getDisplacement()).toProjected();
     63        return CoordinateConversion.enToProj(en.subtract(settings.getDisplacement()));
    6364    }
    6465
     
    102103        if (requiresReprojection()) {
    103104            LatLon ll = getProjecting().eastNorth2latlonClamped(mapView.getEastNorth(sx, sy));
    104             return tileSource.latLonToTileXY(ll.toCoordinate(), zoom);
     105            return tileSource.latLonToTileXY(CoordinateConversion.llToCoor(ll), zoom);
    105106        } else {
    106107            IProjected p = shiftDisplayToServer(mapView.getEastNorth(sx, sy));
     
    165166            LatLon topLeft = mapView.getLatLon(0, 0);
    166167            LatLon botRight = mapView.getLatLon(mapView.getWidth(), mapView.getHeight());
    167             t1 = tileSource.latLonToTileXY(topLeft.toCoordinate(), zoom);
    168             t2 = tileSource.latLonToTileXY(botRight.toCoordinate(), zoom);
     168            t1 = tileSource.latLonToTileXY(CoordinateConversion.llToCoor(topLeft), zoom);
     169            t2 = tileSource.latLonToTileXY(CoordinateConversion.llToCoor(botRight), zoom);
    169170        } else {
    170171            EastNorth topLeftEN = mapView.getEastNorth(0, 0);
    171172            EastNorth botRightEN = mapView.getEastNorth(mapView.getWidth(), mapView.getHeight());
    172             t1 = tileSource.projectedToTileXY(topLeftEN.toProjected(), zoom);
    173             t2 = tileSource.projectedToTileXY(botRightEN.toProjected(), zoom);
     173            t1 = tileSource.projectedToTileXY(CoordinateConversion.enToProj(topLeftEN), zoom);
     174            t2 = tileSource.projectedToTileXY(CoordinateConversion.enToProj(botRightEN), zoom);
    174175        }
    175176        int screenPixels = mapView.getWidth()*mapView.getHeight();
Note: See TracChangeset for help on using the changeset viewer.