Changeset 30244 in osm for applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java
- Timestamp:
- 2014-01-31T13:51:51+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java
r30223 r30244 119 119 setMinimumSize(new Dimension(tileSource.getTileSize(), tileSource.getTileSize())); 120 120 setPreferredSize(new Dimension(400, 400)); 121 setDisplayPosition ByLatLon(50, 9, 3);121 setDisplayPosition(new Coordinate(50, 9), 3); 122 122 //setToolTipText(""); 123 123 } … … 190 190 * {@link #MIN_ZOOM} <= zoom level <= {@link #MAX_ZOOM} 191 191 */ 192 public void setDisplayPosition ByLatLon(double lat, double lon, int zoom) {193 setDisplayPosition ByLatLon(new Point(getWidth() / 2, getHeight() / 2), lat, lon, zoom);192 public void setDisplayPosition(Coordinate to, int zoom) { 193 setDisplayPosition(new Point(getWidth() / 2, getHeight() / 2), to, zoom); 194 194 } 195 195 … … 210 210 * {@link TileSource#getMaxZoom()} 211 211 */ 212 public void setDisplayPosition ByLatLon(Point mapPoint, double lat, double lon, int zoom) {213 int x = OsmMercator.LonToX( lon, zoom);214 int y = OsmMercator.LatToY( lat, zoom);212 public void setDisplayPosition(Point mapPoint, Coordinate to, int zoom) { 213 int x = OsmMercator.LonToX(to.getLon(), zoom); 214 int y = OsmMercator.LatToY(to.getLat(), zoom); 215 215 setDisplayPosition(mapPoint, x, y, zoom); 216 216 } … … 818 818 tileController.cancelOutstandingJobs(); // Clearing outstanding load 819 819 // requests 820 setDisplayPosition ByLatLon(mapPoint, zoomPos.getLat(), zoomPos.getLon(), zoom);820 setDisplayPosition(mapPoint, zoomPos, zoom); 821 821 822 822 this.fireJMVEvent(new JMVCommandEvent(COMMAND.ZOOM, this));
Note:
See TracChangeset
for help on using the changeset viewer.