diff --git a/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java b/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
index 0813aaf25d..16e81102ee 100644
a
|
b
|
implements ImageObserver, TileLoaderListener, ZoomChangeListener, FilterChangeLi
|
888 | 888 | Tile tile = getTile(x, y, zoom); |
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); |
894 | 894 | } |
diff --git a/src/org/openstreetmap/josm/gui/layer/imagery/ReprojectionTile.java b/src/org/openstreetmap/josm/gui/layer/imagery/ReprojectionTile.java
index 2f3d948b46..0da3cdf346 100644
a
|
b
|
package org.openstreetmap.josm.gui.layer.imagery;
|
4 | 4 | import java.awt.Dimension; |
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; |
9 | 11 | import org.openstreetmap.gui.jmapviewer.interfaces.TileSource; |
10 | 12 | import org.openstreetmap.josm.data.ProjectionBounds; |
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; |
15 | 18 | import org.openstreetmap.josm.data.projection.Projections; |
… |
… |
import org.openstreetmap.josm.tools.bugreport.BugReport;
|
25 | 28 | */ |
26 | 29 | public class ReprojectionTile extends Tile { |
27 | 30 | |
| 31 | private final Tile tile; |
28 | 32 | protected TileAnchor anchor; |
29 | 33 | private double nativeScale; |
30 | 34 | protected boolean maxZoomReached; |
31 | 35 | |
32 | 36 | /** |
33 | 37 | * Constructs a new {@code ReprojectionTile}. |
34 | | * @param source sourec tile |
| 38 | * @param source source tile |
35 | 39 | * @param xtile X coordinate |
36 | 40 | * @param ytile Y coordinate |
37 | 41 | * @param zoom zoom level |
38 | 42 | */ |
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 | |
43 | 57 | /** |
… |
… |
public class ReprojectionTile extends Tile {
|
74 | 88 | return !maxZoomReached || currentScale >= nativeScale; |
75 | 89 | } |
76 | 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 | } |
| 98 | } |
| 99 | |
77 | 100 | @Override |
78 | 101 | public void setImage(BufferedImage image) { |
79 | 102 | if (image == null) { |