Changeset 30244 in osm for applications/viewer/jmapviewer
- Timestamp:
- 2014-01-31T13:51:51+01:00 (11 years ago)
- Location:
- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Demo.java
r30223 r30244 205 205 map().addMapRectangle(new MapRectangleImpl(wales, "Wales", c(53.35,-4.57), c(51.64,-2.63))); 206 206 207 // map.setDisplayPosition ByLatLon(49.807, 8.6, 11);207 // map.setDisplayPosition(new Coordinate(49.807, 8.6), 11); 208 208 // map.setTileGridVisible(true); 209 209 -
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.