Ignore:
Timestamp:
2014-01-31T13:51:51+01:00 (11 years ago)
Author:
glebius
Message:

To match getPosition() and simplify code rename setDisplayPositionByLatLon()
into setDisplayPosition(Coordinate to, ...).

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  
    205205        map().addMapRectangle(new MapRectangleImpl(wales, "Wales", c(53.35,-4.57), c(51.64,-2.63)));
    206206
    207         // map.setDisplayPositionByLatLon(49.807, 8.6, 11);
     207        // map.setDisplayPosition(new Coordinate(49.807, 8.6), 11);
    208208        // map.setTileGridVisible(true);
    209209
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java

    r30223 r30244  
    119119        setMinimumSize(new Dimension(tileSource.getTileSize(), tileSource.getTileSize()));
    120120        setPreferredSize(new Dimension(400, 400));
    121         setDisplayPositionByLatLon(50, 9, 3);
     121        setDisplayPosition(new Coordinate(50, 9), 3);
    122122        //setToolTipText("");
    123123    }
     
    190190     *            {@link #MIN_ZOOM} <= zoom level <= {@link #MAX_ZOOM}
    191191     */
    192     public void setDisplayPositionByLatLon(double lat, double lon, int zoom) {
    193         setDisplayPositionByLatLon(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);
    194194    }
    195195
     
    210210     *            {@link TileSource#getMaxZoom()}
    211211     */
    212     public void setDisplayPositionByLatLon(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);
    215215        setDisplayPosition(mapPoint, x, y, zoom);
    216216    }
     
    818818        tileController.cancelOutstandingJobs(); // Clearing outstanding load
    819819        // requests
    820         setDisplayPositionByLatLon(mapPoint, zoomPos.getLat(), zoomPos.getLon(), zoom);
     820        setDisplayPosition(mapPoint, zoomPos, zoom);
    821821
    822822        this.fireJMVEvent(new JMVCommandEvent(COMMAND.ZOOM, this));
Note: See TracChangeset for help on using the changeset viewer.