Changeset 13387 in josm
- Timestamp:
- 2018-02-06T23:39:53+01:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java
r13119 r13387 720 720 @Override 721 721 public int getTileSize() { 722 // no support for non-square tiles (tileHeight != tileWidth) 723 // and for different tile sizes at different zoom levels 724 Collection<Layer> projLayers = getLayers(null, tileProjection.toCode()); 725 if (!projLayers.isEmpty()) { 726 return projLayers.iterator().next().tileMatrixSet.tileMatrix.get(0).tileHeight; 722 if (tileProjection != null) { 723 // no support for non-square tiles (tileHeight != tileWidth) 724 // and for different tile sizes at different zoom levels 725 Collection<Layer> projLayers = getLayers(null, tileProjection.toCode()); 726 if (!projLayers.isEmpty()) { 727 return projLayers.iterator().next().tileMatrixSet.tileMatrix.get(0).tileHeight; 728 } 727 729 } 728 730 // if no layers is found, fallback to default mercator tile size. Maybe it will work … … 1059 1061 @Override 1060 1062 public String getServerCRS() { 1061 return tileProjection.toCode(); 1063 return tileProjection != null ? tileProjection.toCode() : null; 1062 1064 } 1063 1065 } -
trunk/src/org/openstreetmap/josm/gui/MapViewState.java
r13181 r13387 159 159 } 160 160 161 @Override 162 public String toString() { 163 return getClass().getName() + " [projecting=" + this.projecting 164 + " viewWidth=" + this.viewWidth 165 + " viewHeight=" + this.viewHeight 166 + " scale=" + this.scale 167 + " topLeft=" + this.topLeft + ']'; 168 } 169 161 170 /** 162 171 * The scale in east/north units per pixel. … … 762 771 return null; 763 772 } 764 } 765 773 774 @Override 775 public String toString() { 776 return "MapViewRectangle [p1=" + p1 + ", p2=" + p2 + ']'; 777 } 778 } 766 779 } -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r13386 r13387 1418 1418 if (coordinateConverter.requiresReprojection()) { 1419 1419 Projection projServer = Projections.getProjectionByCode(tileSource.getServerCRS()); 1420 if (projServer == null) { 1421 throw new IllegalStateException(tileSource.toString()); 1422 } 1420 1423 ProjectionBounds projBounds = new ProjectionBounds( 1421 1424 CoordinateConversion.projToEn(topLeftUnshifted), … … 1889 1892 try { 1890 1893 drawInViewArea(graphics.getDefaultGraphics(), graphics.getMapView(), graphics.getClipBounds().getProjectionBounds()); 1891 } catch (IllegalArgumentException e) { 1894 } catch (IllegalArgumentException | IllegalStateException e) { 1892 1895 throw BugReport.intercept(e) 1893 1896 .put("graphics", graphics).put("tileSource", tileSource).put("currentZoomLevel", currentZoomLevel); -
trunk/src/org/openstreetmap/josm/gui/layer/MapViewGraphics.java
r10458 r13387 60 60 return clipBounds; 61 61 } 62 63 @Override 64 public String toString() { 65 return "MapViewGraphics [graphics=" + graphics + ", mapView=" + mapView + ", clipBounds=" + clipBounds + ']'; 66 } 62 67 } -
trunk/src/org/openstreetmap/josm/gui/layer/imagery/TileCoordinateConverter.java
r12669 r13387 202 202 */ 203 203 public boolean requiresReprojection() { 204 return !tileSource.getServerCRS() .equals(Main.getProjection().toCode());204 return !Objects.equals(tileSource.getServerCRS(), Main.getProjection().toCode()); 205 205 } 206 206 }
Note:
See TracChangeset
for help on using the changeset viewer.