- Timestamp:
- 2017-04-27T23:02:42+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r11995 r12010 56 56 import org.openstreetmap.josm.data.Bounds; 57 57 import org.openstreetmap.josm.data.Preferences; 58 import org.openstreetmap.josm.data.ProjectionBounds;59 58 import org.openstreetmap.josm.data.UndoRedoHandler; 60 import org.openstreetmap.josm.data.ViewportData;61 59 import org.openstreetmap.josm.data.cache.JCSCacheManager; 62 60 import org.openstreetmap.josm.data.coor.CoordinateFormat; … … 75 73 import org.openstreetmap.josm.gui.ProgramArguments.Option; 76 74 import org.openstreetmap.josm.gui.io.SaveLayersDialog; 77 import org.openstreetmap.josm.gui.layer.Layer;78 75 import org.openstreetmap.josm.gui.layer.MainLayerManager; 79 76 import org.openstreetmap.josm.gui.layer.OsmDataLayer.CommandQueueListener; … … 620 617 621 618 /** 622 * Add a new layer to the map.623 *624 * If no map exists, create one.625 *626 * @param layer the layer627 * @param bounds the bounds of the layer (target zoom area); can be null, then628 * the viewport isn't changed629 */630 public final void addLayer(Layer layer, ProjectionBounds bounds) {631 addLayer(layer, bounds == null ? null : new ViewportData(bounds));632 }633 634 /**635 * Add a new layer to the map.636 *637 * If no map exists, create one.638 *639 * @param layer the layer640 * @param viewport the viewport to zoom to; can be null, then the viewport isn't changed641 */642 public final void addLayer(Layer layer, ViewportData viewport) {643 getLayerManager().addLayer(layer);644 if (viewport != null && Main.map.mapView != null) {645 // MapView may be null in headless mode here.646 Main.map.mapView.scheduleZoomTo(viewport);647 }648 }649 650 /**651 619 * Replies the current selected primitives, from a end-user point of view. 652 620 * It is not always technically the same collection of primitives than {@link DataSet#getSelected()}.
Note:
See TracChangeset
for help on using the changeset viewer.