Ignore:
Timestamp:
2009-07-26T11:16:21+02:00 (15 years ago)
Author:
stoecker
Message:

fixes for newer JOSM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/utilsplugin/src/UtilsPlugin/JumpToAction.java

    r16419 r16687  
    2222import org.openstreetmap.josm.data.ProjectionBounds;
    2323import org.openstreetmap.josm.data.coor.LatLon;
    24 import org.openstreetmap.josm.gui.NavigatableComponent;
     24import org.openstreetmap.josm.gui.MapView;
    2525import org.openstreetmap.josm.tools.GBC;
    2626import org.openstreetmap.josm.tools.OsmUrlToBounds;
     
    4040    private double zoomFactor = 0;
    4141    public void showJumpToDialog() {
    42         LatLon curPos=Main.proj.eastNorth2latlon(Main.map.mapView.getCenter());
     42        MapView mv = Main.map.mapView;
     43        LatLon curPos=mv.getProjection().eastNorth2latlon(mv.getCenter());
    4344        lat.setText(java.lang.Double.toString(curPos.lat()));
    4445        lon.setText(java.lang.Double.toString(curPos.lon()));
    4546
    46         double dist = Main.map.mapView.getDist100Pixel();
     47        double dist = mv.getDist100Pixel();
    4748        zoomFactor = 1/dist;
    4849
     
    115116        }
    116117
    117         Main.map.mapView.zoomToFactor(Main.proj.latlon2eastNorth(ll), zoomFactor * zoomLvl);
     118        mv.zoomToFactor(mv.getProjection().latlon2eastNorth(ll), zoomFactor * zoomLvl);
    118119    }
    119120
     
    165166     */
    166167    public int getZoom(double scale) {
    167         double sizex = scale * Main.map.mapView.getWidth();
    168         double sizey = scale * Main.map.mapView.getHeight();
    169         ProjectionBounds b = Main.proj.getWorldBounds();
     168        MapView mv = Main.map.mapView;
     169        double sizex = scale * mv.getWidth();
     170        double sizey = scale * mv.getHeight();
     171        ProjectionBounds b = mv.getMaxProjectionBounds();
    170172        for (int zoom = 0; zoom <= 32; zoom++, sizex *= 2, sizey *= 2) {               
    171173            if (sizex > b.max.east() || sizey > b.max.north())
Note: See TracChangeset for help on using the changeset viewer.