Changeset 31573 in osm for applications/viewer/jmapviewer


Ignore:
Timestamp:
2015-09-21T02:20:19+02:00 (9 years ago)
Author:
donvip
Message:

remove deprecated code

Location:
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java

    r31541 r31573  
    457457        Point p = tileSource.latLonToXY(lat, lon, zoom);
    458458        int y = p.y - center.y - getHeight() / 2;
    459         if (checkOutside && (y < 0 || y > getHeight())) {
    460             return null;
    461         }
    462         return y;
    463     }
    464 
    465     /**
    466      * Calculates the position on the map of a given coordinate
    467      *
    468      * @param lat Latitude
    469      * @param offset Offset respect Latitude
    470      * @param checkOutside check if the point is outside the displayed area
    471      * @return Integer the radius in pixels
    472      * @deprecated use {@link #getLatOffset(double, double, double, boolean)}
    473      */
    474     @Deprecated
    475     public Integer getLatOffset(double lat, double offset, boolean checkOutside) {
    476         int y = tileSource.latToY(lat + offset, zoom);
    477         y -= center.y - getHeight() / 2;
    478459        if (checkOutside && (y < 0 || y > getHeight())) {
    479460            return null;
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/interfaces/TileSource.java

    r31522 r31573  
    1818
    1919    /**
    20      * Specifies the different mechanisms for detecting updated tiles
    21      * respectively only download newer tiles than those stored locally.
    22      *
    23      * <ul>
    24      * <li>{@link #IfNoneMatch} Server provides ETag header entry for all tiles
    25      * and <b>supports</b> conditional download via <code>If-None-Match</code>
    26      * header entry.</li>
    27      * <li>{@link #ETag} Server provides ETag header entry for all tiles but
    28      * <b>does not support</b> conditional download via
    29      * <code>If-None-Match</code> header entry.</li>
    30      * <li>{@link #IfModifiedSince} Server provides Last-Modified header entry
    31      * for all tiles and <b>supports</b> conditional download via
    32      * <code>If-Modified-Since</code> header entry.</li>
    33      * <li>{@link #LastModified} Server provides Last-Modified header entry for
    34      * all tiles but <b>does not support</b> conditional download via
    35      * <code>If-Modified-Since</code> header entry.</li>
    36      * <li>{@link #None} The server does not support any of the listed
    37      * mechanisms.</li>
    38      * </ul>
    39      *
    40      * @deprecated not used anymore
    41      */
    42     @Deprecated
    43     enum TileUpdate {
    44         IfNoneMatch, ETag, IfModifiedSince, LastModified, None
    45     }
    46 
    47     /**
    4820     * Specifies the maximum zoom value. The number of zoom levels is [0..
    4921     * {@link #getMaxZoom()}].
     
    6234     */
    6335    int getMinZoom();
    64 
    65     /**
    66      * @return The supported tile update mechanism
    67      * @see TileUpdate
    68      */
    69     TileUpdate getTileUpdate();
    7036
    7137    /**
     
    13197
    13298    /**
    133      * Transform longitude to pixelspace.
    134      * @param aLongitude longitude
    135      * @param aZoomlevel zoom level
    136      * @return [0..2^Zoomlevel*TILE_SIZE[
    137      * @deprecated use {@link #latLonToXY(double, double, int)} instead
    138      */
    139     @Deprecated
    140     int lonToX(double aLongitude, int aZoomlevel);
    141 
    142     /**
    143      * Transforms latitude to pixelspace.
    144      * @param aLat latitude
    145      * @param aZoomlevel zoom level
    146      * @return [0..2^Zoomlevel*TILE_SIZE[
    147      * @deprecated use {@link #latLonToXY(double, double, int)} instead
    148      */
    149     @Deprecated
    150     int latToY(double aLat, int aZoomlevel);
    151 
    152     /**
    15399     * @param lon longitude
    154100     * @param lat latitude
     
    166112
    167113    /**
    168      * Transforms pixel coordinate X to longitude
    169      * @param aX X coordinate
    170      * @param aZoomlevel zoom level
    171      * @return ]-180..180[
    172      * @deprecated use {@link #xyToLatLon(int, int, int)} instead
    173      */
    174     @Deprecated
    175     double XToLon(int aX, int aZoomlevel);
    176 
    177     /**
    178      * Transforms pixel coordinate Y to latitude.
    179      * @param aY Y coordinate
    180      * @param aZoomlevel zoom level
    181      * @return [MIN_LAT..MAX_LAT]
    182      * @deprecated use {@link #xyToLatLon(int, int, int)} instead
    183      */
    184     @Deprecated
    185     double YToLat(int aY, int aZoomlevel);
    186 
    187     /**
    188114     * @param point point
    189115     * @param zoom zoom level
     
    202128
    203129    /**
    204      * Transforms longitude to X tile coordinate.
    205      * @param lon longitude
    206      * @param zoom zoom level
    207      * @return [0..2^Zoomlevel[
    208      * @deprecated use {@link #latLonToTileXY(double, double, int)} instead
    209      */
    210     @Deprecated
    211     double lonToTileX(double lon, int zoom);
    212 
    213     /**
    214      * Transforms latitude to Y tile coordinate.
    215      * @param lat latitude
    216      * @param zoom zoom level
    217      * @return [0..2^Zoomlevel[
    218      * @deprecated use {@link #latLonToTileXY(double, double, int)} instead
    219      */
    220     @Deprecated
    221     double latToTileY(double lat, int zoom);
    222 
    223     /**
    224130     * @param lon longitude
    225131     * @param lat latitude
     
    236142     */
    237143    TileXY latLonToTileXY(ICoordinate point, int zoom);
    238 
    239     /**
    240      * Transforms tile X coordinate to longitude.
    241      * @param x X coordinate
    242      * @param zoom zoom level
    243      * @return ]-180..180[
    244      * @deprecated use {@link #tileXYToLatLon(int, int, int)} instead
    245      */
    246     @Deprecated
    247     double tileXToLon(int x, int zoom);
    248 
    249     /**
    250      * Transforms tile Y coordinate to latitude.
    251      * @param y Y coordinate
    252      * @param zoom zoom level
    253      * @return [MIN_LAT..MAX_LAT]
    254      * @deprecated use {@link #tileXYToLatLon(int, int, int)} instead
    255      */
    256     @Deprecated
    257     double tileYToLat(int y, int zoom);
    258144
    259145    /**
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractMapQuestTileSource.java

    r30900 r31573  
    1212
    1313    // MapQuest logo in base64: http://developer.mapquest.com/content/osm/mq_logo.png
    14     private static final String LOGO_BASE64 = 
     14    private static final String LOGO_BASE64 =
    1515            "iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJl"+
    1616            "YWR5ccllPAAAAZtJREFUeNpi/P//P0PPcYf/DGSAEssDjIzdx+zJ0gwDLMQqVBWyZVAStGRgBMK33x8wnH62"+
     
    2828
    2929    private static final int NUMBER_OF_SERVERS = 4;
    30    
     30
    3131    private int SERVER_NUM = 1;
    3232
     
    4040        SERVER_NUM = (SERVER_NUM % NUMBER_OF_SERVERS) + 1;
    4141        return url;
    42     }
    43 
    44     @Override
    45     public TileUpdate getTileUpdate() {
    46         return TileUpdate.IfModifiedSince;
    4742    }
    4843
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractTMSTileSource.java

    r31438 r31573  
    129129
    130130    @Override
    131     public int lonToX(double lon, int zoom) {
    132         return (int) osmMercator.lonToX(lon, zoom);
    133     }
    134 
    135     @Override
    136     public int latToY(double lat, int zoom) {
    137         return (int) osmMercator.latToY(lat, zoom);
    138     }
    139 
    140     @Override
    141131    public Point latLonToXY(double lat, double lon, int zoom) {
    142132        return new Point(
     
    152142
    153143    @Override
    154     public double XToLon(int x, int zoom) {
    155         return osmMercator.xToLon(x, zoom);
    156     }
    157 
    158     @Override
    159     public double YToLat(int y, int zoom) {
    160         return osmMercator.yToLat(y, zoom);
    161     }
    162 
    163     @Override
    164144    public ICoordinate xyToLatLon(Point point, int zoom) {
    165145        return xyToLatLon(point.x, point.y, zoom);
     
    175155
    176156    @Override
    177     public double latToTileY(double lat, int zoom) {
    178         return osmMercator.latToY(lat, zoom) / tileSize;
    179     }
    180 
    181     @Override
    182     public double lonToTileX(double lon, int zoom) {
    183         return osmMercator.lonToX(lon, zoom) / tileSize;
    184     }
    185 
    186     @Override
    187157    public TileXY latLonToTileXY(double lat, double lon, int zoom) {
    188158        return new TileXY(
     
    195165    public TileXY latLonToTileXY(ICoordinate point, int zoom) {
    196166        return latLonToTileXY(point.getLat(), point.getLon(), zoom);
    197     }
    198 
    199     @Override
    200     public double tileYToLat(int y, int zoom) {
    201         return osmMercator.yToLat(y * tileSize, zoom);
    202     }
    203 
    204     @Override
    205     public double tileXToLon(int x, int zoom) {
    206         return osmMercator.xToLon(x * tileSize, zoom);
    207167    }
    208168
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java

    r31539 r31573  
    173173
    174174    @Override
    175     public TileUpdate getTileUpdate() {
    176         return TileUpdate.IfNoneMatch;
    177     }
    178 
    179     @Override
    180175    public boolean requiresAttribution() {
    181176        return true;
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/OsmTileSource.java

    r31434 r31573  
    3131            return url;
    3232        }
    33 
    34         @Override
    35         public TileUpdate getTileUpdate() {
    36             return TileUpdate.IfNoneMatch;
    37         }
    3833    }
    3934
     
    6762            return 18;
    6863        }
    69 
    70         @Override
    71         public TileUpdate getTileUpdate() {
    72             return TileUpdate.LastModified;
    73         }
    7464    }
    7565}
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/ScanexTileSource.java

    r31438 r31573  
    9393    }
    9494
    95     @Override
    96     public int latToY(double lat, int zoom) {
    97         return (int) (latToTileY(lat, zoom) * tileSize);
    98     }
    99 
    100     @Override
    101     public double YToLat(int y, int zoom) {
    102         return tileYToLat((double) y / tileSize, zoom);
    103     }
    104 
    105     @Override
    106     public double latToTileY(double lat, int zoom) {
    107         double tmp = Math.tan(Math.PI/4 * (1 + lat/90));
    108         double pow = Math.pow(Math.tan(Math.PI/4 + Math.asin(E * Math.sin(Math.toRadians(lat)))/2), E);
    109 
    110         return (EQUATOR/2 - (RADIUS_E * Math.log(tmp/pow))) * Math.pow(2.0, zoom) / EQUATOR;
    111     }
    112 
    113     @Override
    114     public double tileYToLat(int y, int zoom) {
    115         return tileYToLat((double) y, zoom);
    116     }
    117 
    11895    /*
    11996     * To solve inverse formula latitude = f(y) we use
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/TMSTileSource.java

    r31122 r31573  
    2323        return (maxZoom == 0) ? super.getMaxZoom() : maxZoom;
    2424    }
    25 
    26     @Override
    27     public TileUpdate getTileUpdate() {
    28         return TileUpdate.IfNoneMatch;
    29     }
    3025}
Note: See TracChangeset for help on using the changeset viewer.