Changeset 5670 in josm for trunk/src/org/openstreetmap/josm/gui/MapView.java
- Timestamp:
- 2013-01-25T22:34:19+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/MapView.java
r5519 r5670 219 219 /** 220 220 * Constructs a new {@code MapView}. 221 * @param contentPane The content pane used to register shortcuts in its {@link InputMap} and {@link ActionMap} 222 */ 223 public MapView(final JPanel contentPane) { 221 * @param contentPane The content pane used to register shortcuts in its 222 * {@link InputMap} and {@link ActionMap} 223 * @param viewportData the initial viewport of the map. Can be null, then 224 * the viewport is derived from the layer data. 225 */ 226 public MapView(final JPanel contentPane, final ViewportData viewportData) { 224 227 Main.pref.addPreferenceChangeListener(this); 225 228 … … 237 240 238 241 mapMover = new MapMover(MapView.this, contentPane); 239 OsmDataLayer layer = getEditLayer(); 240 if (layer != null) { 241 if (!zoomToDataSetBoundingBox(layer.data)) { 242 // no bounding box defined 243 AutoScaleAction.autoScale("data"); 242 if (viewportData != null) { 243 zoomTo(viewportData.getCenter(), viewportData.getScale()); 244 } else { 245 OsmDataLayer layer = getEditLayer(); 246 if (layer != null) { 247 if (!zoomToDataSetBoundingBox(layer.data)) { 248 // no bounding box defined 249 AutoScaleAction.autoScale("data"); 250 } 251 } else { 252 AutoScaleAction.autoScale("layer"); 244 253 } 245 } else {246 AutoScaleAction.autoScale("layer");247 254 } 248 255 }
Note:
See TracChangeset
for help on using the changeset viewer.