Ticket #9654: use_tileSource_instead_of_OsmMercator.diff
File use_tileSource_instead_of_OsmMercator.diff, 3.1 KB (added by , 10 years ago) |
---|
-
core/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java
import org.openstreetmap.gui.jmapviewer.Coordinate 25 25 import org.openstreetmap.gui.jmapviewer.JMapViewer; 26 26 import org.openstreetmap.gui.jmapviewer.MapMarkerDot; 27 27 import org.openstreetmap.gui.jmapviewer.MemoryTileCache; 28 import org.openstreetmap.gui.jmapviewer.OsmMercator;29 28 import org.openstreetmap.gui.jmapviewer.OsmTileLoader; 30 29 import org.openstreetmap.gui.jmapviewer.interfaces.MapMarker; 31 30 import org.openstreetmap.gui.jmapviewer.interfaces.TileSource; … … public class SlippyMapBBoxChooser extends JMapView 328 327 minLon -= 360.0; 329 328 } 330 329 331 int y1 = OsmMercator.LatToY(bbox.getMinLat(), MAX_ZOOM);332 int y2 = OsmMercator.LatToY(bbox.getMaxLat(), MAX_ZOOM);333 int x1 = OsmMercator.LonToX(minLon, MAX_ZOOM);334 int x2 = OsmMercator.LonToX(maxLon, MAX_ZOOM);330 int y1 = tileSource.LatToY(bbox.getMinLat(), MAX_ZOOM); 331 int y2 = tileSource.LatToY(bbox.getMaxLat(), MAX_ZOOM); 332 int x1 = tileSource.LonToX(minLon, MAX_ZOOM); 333 int x2 = tileSource.LonToX(maxLon, MAX_ZOOM); 335 334 336 335 iSelectionRectStart = new Point(Math.min(x1, x2), Math.min(y1, y2)); 337 336 iSelectionRectEnd = new Point(Math.max(x1, x2), Math.max(y1, y2)); -
core/src/org/openstreetmap/josm/gui/bbox/TileSelectionBBoxChooser.java
import javax.swing.text.JTextComponent; 41 41 42 42 import org.openstreetmap.gui.jmapviewer.JMapViewer; 43 43 import org.openstreetmap.gui.jmapviewer.MapMarkerDot; 44 import org.openstreetmap.gui.jmapviewer.OsmMercator;45 44 import org.openstreetmap.gui.jmapviewer.OsmTileLoader; 46 45 import org.openstreetmap.gui.jmapviewer.interfaces.MapMarker; 47 46 import org.openstreetmap.gui.jmapviewer.interfaces.TileLoader; … … public class TileSelectionBBoxChooser extends JPan 680 679 min = null; 681 680 max = null; 682 681 } else { 683 int y1 = OsmMercator.LatToY(bbox.getMinLat(), MAX_ZOOM);684 int y2 = OsmMercator.LatToY(bbox.getMaxLat(), MAX_ZOOM);685 int x1 = OsmMercator.LonToX(bbox.getMinLon(), MAX_ZOOM);686 int x2 = OsmMercator.LonToX(bbox.getMaxLon(), MAX_ZOOM);682 int y1 = tileSource.LatToY(bbox.getMinLat(), MAX_ZOOM); 683 int y2 = tileSource.LatToY(bbox.getMaxLat(), MAX_ZOOM); 684 int x1 = tileSource.LonToX(bbox.getMinLon(), MAX_ZOOM); 685 int x2 = tileSource.LonToX(bbox.getMaxLon(), MAX_ZOOM); 687 686 688 687 min = new Point(Math.min(x1, x2), Math.min(y1, y2)); 689 688 max = new Point(Math.max(x1, x2), Math.max(y1, y2));