Changeset 4079 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2011-05-09T21:50:34+02:00 (14 years ago)
Author:
jttt
Message:

Add action Zoom to native resolution to wms layer

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r4065 r4079  
    280280     * @param scale The scale to use.
    281281     */
    282     private void zoomTo(EastNorth newCenter, double newScale) {
     282    public void zoomTo(EastNorth newCenter, double newScale) {
    283283        Bounds b = getProjection().getWorldBoundsLatLon();
    284284        CachedLatLon cl = new CachedLatLon(newCenter);
  • trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java

    r4065 r4079  
    421421                new BookmarkWmsAction(),
    422422                SeparatorLayerAction.INSTANCE,
     423                new ZoomToNativeResolution(),
    423424                new StartStopAction(),
    424425                new ToggleAlphaAction(),
     
    785786    }
    786787
     788    private class ZoomToNativeResolution extends AbstractAction {
     789
     790        public ZoomToNativeResolution() {
     791            super(tr("Zoom to native resolution"));
     792        }
     793
     794        @Override
     795        public void actionPerformed(ActionEvent e) {
     796            Main.map.mapView.zoomTo(Main.map.mapView.getCenter(), 1 / info.getPixelPerDegree());
     797        }
     798
     799    }
     800
    787801    private void cancelGrabberThreads(boolean wait) {
    788802        requestQueueLock.lock();
Note: See TracChangeset for help on using the changeset viewer.