Changeset 32024 in osm for applications/viewer


Ignore:
Timestamp:
2016-01-24T22:52:12+01:00 (9 years ago)
Author:
wiktorn
Message:

Finish removal of tile-size workaround code started in [josm9617].

Now WMTS TileSources with other than 256px tile size should work
properly.
See #josm12437, #josm12186

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

Legend:

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

    r32023 r32024  
    5050        this.metadataHeaders = info.getMetadataHeaders();
    5151        this.tileSize = info.getTileSize();
    52         this.osmMercator = new OsmMercator(this.tileSize);
     52        this.osmMercator = new OsmMercator(this.getTileSize());
    5353    }
    5454
     
    161161    public TileXY latLonToTileXY(double lat, double lon, int zoom) {
    162162        return new TileXY(
    163                 osmMercator.lonToX(lon, zoom) / tileSize,
    164                 osmMercator.latToY(lat, zoom) / tileSize
     163                osmMercator.lonToX(lon, zoom) / getTileSize(),
     164                osmMercator.latToY(lat, zoom) / getTileSize()
    165165                );
    166166    }
     
    184184    public ICoordinate tileXYToLatLon(int x, int y, int zoom) {
    185185        return new Coordinate(
    186                 osmMercator.yToLat(y * tileSize, zoom),
    187                 osmMercator.xToLon(x * tileSize, zoom)
     186                osmMercator.yToLat(y * getTileSize(), zoom),
     187                osmMercator.xToLon(x * getTileSize(), zoom)
    188188                );
    189189    }
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/TileSourceInfo.java

    r32022 r32024  
    44import java.util.List;
    55import java.util.Map;
    6 
    7 import org.openstreetmap.gui.jmapviewer.OsmMercator;
    86
    97/**
     
    3836
    3937    /** tile size of the displayed tiles */
    40     private int tileSize = OsmMercator.DEFAUL_TILE_SIZE; // FIXME: set to -1 for next release
     38    private int tileSize = -1;
    4139
    4240    /** mapping <header key, metadata key> */
Note: See TracChangeset for help on using the changeset viewer.