- Timestamp:
- 2016-06-16T00:07:13+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r10391 r10394 570 570 @Override 571 571 public void layerAdded(LayerAddEvent e) { 572 Layer layer = e.getAddedLayer(); 572 573 if (map == null) { 573 Layer layer = e.getAddedLayer(); 574 ProjectionBounds viewProjectionBounds = layer.getViewProjectionBounds(); 575 Main.main.createMapFrame(layer, viewProjectionBounds == null ? null : new ViewportData(viewProjectionBounds)); 574 Main.main.createMapFrame(layer, null); 575 Main.map.setVisible(true); 576 } 577 ProjectionBounds viewProjectionBounds = layer.getViewProjectionBounds(); 578 if (viewProjectionBounds != null) { 579 Main.map.mapView.scheduleZoomTo(new ViewportData(viewProjectionBounds)); 576 580 } 577 581 } … … 820 824 public final synchronized void addLayer(final Layer layer, ViewportData viewport) { 821 825 getLayerManager().addLayer(layer); 822 if (map != null) { 823 Main.map.setVisible(true); 824 } else if (viewport != null) { 825 Main.map.mapView.zoomTo(viewport); 826 if (viewport != null) { 827 Main.map.mapView.scheduleZoomTo(viewport); 826 828 } 827 829 } -
trunk/src/org/openstreetmap/josm/gui/MapView.java
r10378 r10394 1291 1291 return layerManager; 1292 1292 } 1293 1294 /** 1295 * Schedule a zoom to the given position on the next redraw. 1296 * Temporary, may be removed without warning. 1297 * @param viewportData 1298 * @since xxx 1299 */ 1300 public void scheduleZoomTo(ViewportData viewportData) { 1301 initialViewport = viewportData; 1302 } 1293 1303 }
Note:
See TracChangeset
for help on using the changeset viewer.