Changeset 8626 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2015-07-28T00:33:09+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/TemplatedWMSTileSource.java
r8624 r8626 8 8 import java.text.DecimalFormatSymbols; 9 9 import java.text.NumberFormat; 10 import java.util.List;11 10 import java.util.Locale; 12 11 import java.util.Map; 12 import java.util.Set; 13 import java.util.TreeSet; 13 14 import java.util.concurrent.ConcurrentHashMap; 14 15 import java.util.regex.Matcher; … … 37 38 public class TemplatedWMSTileSource extends TMSTileSource implements TemplatedTileSource { 38 39 private Map<String, String> headers = new ConcurrentHashMap<>(); 39 private final List<String> serverProjections;40 private final Set<String> serverProjections; 40 41 private EastNorth topLeftCorner; 41 42 private Bounds worldBounds; … … 63 64 public TemplatedWMSTileSource(ImageryInfo info) { 64 65 super(info); 65 this.serverProjections = info.getServerProjections(); 66 this.serverProjections = new TreeSet<>(info.getServerProjections()); 66 67 handleTemplate(); 67 68 initProjection(); … … 143 144 // CHECKSTYLE.ON: LineLength 144 145 boolean switchLatLon = false; 145 if (baseUrl.toLowerCase().contains("crs=epsg:4326")) { 146 if (baseUrl.toLowerCase(Locale.US).contains("crs=epsg:4326")) { 146 147 switchLatLon = true; 147 } else if (baseUrl.toLowerCase().contains("crs=")) { 148 } else if (baseUrl.toLowerCase(Locale.US).contains("crs=")) { 148 149 // assume WMS 1.3.0 149 150 switchLatLon = Main.getProjection().switchXY(); … … 354 355 EastNorth max = proj.latlon2eastNorth(worldBounds.getMax()); 355 356 356 int tilesPerZoom = (int) Math.pow(2, zoom - 1); 357 int tilesPerZoom = (int) Math.pow(2d, zoom - 1); 357 358 return Math.max( 358 359 Math.abs(max.getY() - min.getY()) / tilesPerZoom, … … 366 367 * pole, the same way they are capped in Mercator projection, so conversions should work properly 367 368 */ 368 private finalstatic Bounds getWorldBounds() {369 private static Bounds getWorldBounds() { 369 370 Projection proj = Main.getProjection(); 370 371 Bounds bounds = proj.getWorldBoundsLatLon();
Note:
See TracChangeset
for help on using the changeset viewer.