Ticket #17591: 17591-scale-follow.patch
| File 17591-scale-follow.patch, 3.4 KB (added by , 7 years ago) |
|---|
-
src/org/openstreetmap/josm/gui/NavigatableComponent.java
107 107 public static final DoubleProperty PROP_ZOOM_RATIO = new DoubleProperty("zoom.ratio", 2.0); 108 108 /** Divide intervals between native resolution levels to smaller steps if they are much larger than zoom ratio */ 109 109 public static final BooleanProperty PROP_ZOOM_INTERMEDIATE_STEPS = new BooleanProperty("zoom.intermediate-steps", true); 110 /** scale follows native resolution of layer status when layer is created */ 111 public static final BooleanProperty PROP_ZOOM_SCALE_FOLLOWS_NATIVE_RESOLUTION_AT_LOAD = new BooleanProperty( 112 "zoom.scale-follow-native-resolution-at-load", true); 110 113 111 114 /** 112 115 * The layer which scale is set to. -
src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
538 538 if (layer instanceof NativeScaleLayer) { 539 539 boolean active = ((NativeScaleLayer) layer) == MainApplication.getMap().mapView.getNativeScaleLayer(); 540 540 cb.setSelected(active); 541 cb.setToolTipText(active 542 ? tr("scale follows native resolution of this layer") 543 : tr("scale follows native resolution of another layer (click to set this layer)") 544 ); 541 if (MainApplication.getMap().mapView.getNativeScaleLayer() != null) { 542 cb.setToolTipText(active 543 ? tr("scale follows native resolution of this layer") 544 : tr("scale follows native resolution of another layer (click to set this layer)")); 545 } else { 546 cb.setToolTipText(tr("scale does not follow native resolution of any layer (click to set this layer)")); 547 } 545 548 } else { 546 549 cb.setSelected(false); 547 550 cb.setToolTipText(tr("this layer has no native resolution")); -
src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
95 95 import org.openstreetmap.josm.gui.ExtendedDialog; 96 96 import org.openstreetmap.josm.gui.MainApplication; 97 97 import org.openstreetmap.josm.gui.MapView; 98 import org.openstreetmap.josm.gui.NavigatableComponent; 98 99 import org.openstreetmap.josm.gui.NavigatableComponent.ZoomChangeListener; 99 100 import org.openstreetmap.josm.gui.Notification; 100 101 import org.openstreetmap.josm.gui.dialogs.LayerListDialog; … … 554 555 event.getMapView().addMouseListener(adapter); 555 556 MapView.addZoomChangeListener(this); 556 557 557 if (this instanceof NativeScaleLayer ) {558 if (this instanceof NativeScaleLayer && NavigatableComponent.PROP_ZOOM_SCALE_FOLLOWS_NATIVE_RESOLUTION_AT_LOAD.get()) { 558 559 event.getMapView().setNativeScaleLayer((NativeScaleLayer) this); 559 560 } 560 561
