Changeset 30245 in osm for applications/viewer/jmapviewer


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

Whenever we change the tileSource, we need to recalculate our
center, since x/y coordinate isn't stable between different
projections. Achieve that wrapping tileSource change into
getPosition() and setDisplayPosition().

This is a prerequisite to fix #7017.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java

    r30244 r30245  
    960960        if (tileSource.getMinZoom() < MIN_ZOOM)
    961961            throw new RuntimeException("Minumim zoom level too low");
     962        Coordinate position = getPosition();
    962963        this.tileSource = tileSource;
    963964        tileController.setTileSource(tileSource);
     
    968969            setZoom(tileSource.getMaxZoom());
    969970        }
    970 
    971971        attribution.initialize(tileSource);
     972        setDisplayPosition(position, zoom);
    972973        repaint();
    973974    }
Note: See TracChangeset for help on using the changeset viewer.