Changeset 18187 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2021-08-31T23:17:15+02:00 (3 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/layer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r17975 r18187 889 889 if (tile == null) { 890 890 if (coordinateConverter.requiresReprojection()) { 891 tile = new ReprojectionTile( tileSource, x, y, zoom);891 tile = new ReprojectionTile(createTile(tileSource, x, y, zoom)); 892 892 } else { 893 893 tile = createTile(tileSource, x, y, zoom); -
trunk/src/org/openstreetmap/josm/gui/layer/imagery/ReprojectionTile.java
r17165 r18187 5 5 import java.awt.geom.Point2D; 6 6 import java.awt.image.BufferedImage; 7 import java.io.IOException; 8 import java.io.InputStream; 7 9 8 10 import org.openstreetmap.gui.jmapviewer.Tile; … … 11 13 import org.openstreetmap.josm.data.coor.EastNorth; 12 14 import org.openstreetmap.josm.data.imagery.CoordinateConversion; 15 import org.openstreetmap.josm.data.imagery.vectortile.VectorTile; 13 16 import org.openstreetmap.josm.data.projection.Projection; 14 17 import org.openstreetmap.josm.data.projection.ProjectionRegistry; … … 26 29 public class ReprojectionTile extends Tile { 27 30 31 private final Tile tile; 28 32 protected TileAnchor anchor; 29 33 private double nativeScale; … … 32 36 /** 33 37 * Constructs a new {@code ReprojectionTile}. 34 * @param source sour ectile38 * @param source source tile 35 39 * @param xtile X coordinate 36 40 * @param ytile Y coordinate … … 39 43 public ReprojectionTile(TileSource source, int xtile, int ytile, int zoom) { 40 44 super(source, xtile, ytile, zoom); 45 this.tile = null; 46 } 47 48 /** 49 * Create a reprojection tile for a specific tile 50 * @param tile The tile to use 51 */ 52 public ReprojectionTile(Tile tile) { 53 super(tile.getTileSource(), tile.getXtile(), tile.getYtile(), tile.getZoom()); 54 this.tile = tile; 41 55 } 42 56 … … 73 87 return false; 74 88 return !maxZoomReached || currentScale >= nativeScale; 89 } 90 91 @Override 92 public void loadImage(InputStream inputStream) throws IOException { 93 if (this.tile instanceof VectorTile) { 94 this.tile.loadImage(inputStream); 95 } else { 96 super.loadImage(inputStream); 97 } 75 98 } 76 99
Note:
See TracChangeset
for help on using the changeset viewer.