Changeset 11860 in josm
- Timestamp:
- 2017-04-09T13:52:57+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSource.java
r11858 r11860 18 18 import org.openstreetmap.josm.Main; 19 19 import org.openstreetmap.josm.data.coor.EastNorth; 20 import org.openstreetmap.josm.data.coor.LatLon;21 20 import org.openstreetmap.josm.data.projection.Projection; 22 21 import org.openstreetmap.josm.gui.layer.WMSLayer; -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r11858 r11860 1076 1076 } 1077 1077 1078 1078 /** 1079 1079 * Draw a tile image on screen. 1080 1080 * @param g the Graphics2D … … 1184 1184 1185 1185 // applying all filters to this layer 1186 img = applyImageProcessors( (BufferedImage)img);1186 img = applyImageProcessors(img); 1187 1187 1188 1188 Shape clip; -
trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
r11858 r11860 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.layer; 3 4 import static org.openstreetmap.josm.tools.I18n.tr;5 3 6 4 import java.util.ArrayList; 7 5 import java.util.Collection; 8 6 import java.util.Collections; 9 import java.util.List;10 7 11 8 import org.apache.commons.jcs.access.CacheAccess; … … 24 21 import org.openstreetmap.josm.data.preferences.BooleanProperty; 25 22 import org.openstreetmap.josm.data.preferences.IntegerProperty; 26 import org.openstreetmap.josm.data.projection.Projection;27 23 28 24 /** -
trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java
r11858 r11860 13 13 import javax.swing.AbstractAction; 14 14 import javax.swing.Action; 15 import javax.swing.JOptionPane;16 15 17 16 import org.apache.commons.jcs.access.CacheAccess; … … 29 28 import org.openstreetmap.josm.data.projection.Projection; 30 29 import org.openstreetmap.josm.data.projection.Projections; 31 import org.openstreetmap.josm.gui.ExtendedDialog;32 30 import org.openstreetmap.josm.gui.layer.imagery.TileSourceDisplaySettings; 33 31 import org.openstreetmap.josm.tools.CheckParameterUtil; -
trunk/src/org/openstreetmap/josm/gui/layer/imagery/ReprojectionTile.java
r11858 r11860 18 18 /** 19 19 * Tile class that stores a reprojected version of the original tile. 20 * @since 11858 20 21 */ 21 22 public class ReprojectionTile extends Tile { … … 25 26 protected boolean maxZoomReached; 26 27 28 /** 29 * Constructs a new {@code ReprojectionTile}. 30 * @param source sourec tile 31 * @param xtile X coordinate 32 * @param ytile Y coordinate 33 * @param zoom zoom level 34 */ 27 35 public ReprojectionTile(TileSource source, int xtile, int ytile, int zoom) { 28 36 super(source, xtile, ytile, zoom); … … 50 58 return true; 51 59 } 52 60 53 61 @Override 54 62 public void setImage(BufferedImage image) { … … 100 108 Dimension dim = getDimension(pbTargetAligned, scaleMapView); 101 109 Integer scaleFix = limitScale(source.getTileSize(), Math.sqrt(dim.getWidth() * dim.getHeight())); 102 double scale = scaleFix == null ? scaleMapView : scaleMapView * scaleFix;110 double scale = scaleFix == null ? scaleMapView : (scaleMapView * scaleFix); 103 111 104 112 ImageWarp.PointTransform pointTransform = pt -> { … … 153 161 */ 154 162 protected Integer limitScale(double lenOrig, double lenNow) { 155 double LIMIT= 3;156 if (lenNow > LIMIT* lenOrig) {157 int n = (int) Math.ceil((Math.log(lenNow) - Math.log( LIMIT* lenOrig)) / Math.log(2));163 final double limit = 3; 164 if (lenNow > limit * lenOrig) { 165 int n = (int) Math.ceil((Math.log(lenNow) - Math.log(limit * lenOrig)) / Math.log(2)); 158 166 int f = 1 << n; 159 167 double lenNowFixed = lenNow / f; 160 if ( !(lenNowFixed <= LIMIT * lenOrig)) throw new AssertionError();161 if ( !(lenNowFixed > LIMIT * lenOrig / 2)) thrownew AssertionError();168 if (lenNowFixed > limit * lenOrig) throw new AssertionError(); 169 if (lenNowFixed <= limit * lenOrig / 2) throw new AssertionError(); 162 170 return f; 163 171 } 164 if (lenNow > LIMIT* lenOrig / 2)172 if (lenNow > limit * lenOrig / 2) 165 173 return 1; 166 174 return null;
Note:
See TracChangeset
for help on using the changeset viewer.