- Timestamp:
- 2016-06-15T20:30:09+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/Main.java
r10387 r10391 88 88 import org.openstreetmap.josm.gui.layer.AbstractModifiableLayer; 89 89 import org.openstreetmap.josm.gui.layer.Layer; 90 import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent; 91 import org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener; 92 import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent; 93 import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent; 90 94 import org.openstreetmap.josm.gui.layer.MainLayerManager; 91 95 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 563 567 public Main() { 564 568 main = this; 569 getLayerManager().addLayerChangeListener(new LayerChangeListener() { 570 @Override 571 public void layerAdded(LayerAddEvent e) { 572 if (map == null) { 573 Layer layer = e.getAddedLayer(); 574 ProjectionBounds viewProjectionBounds = layer.getViewProjectionBounds(); 575 Main.main.createMapFrame(layer, viewProjectionBounds == null ? null : new ViewportData(viewProjectionBounds)); 576 } 577 } 578 579 @Override 580 public void layerRemoving(LayerRemoveEvent e) { 581 // empty 582 } 583 584 @Override 585 public void layerOrderChanged(LayerOrderChangeEvent e) { 586 //empty 587 } 588 589 }); 565 590 } 566 591 … … 794 819 */ 795 820 public final synchronized void addLayer(final Layer layer, ViewportData viewport) { 796 boolean noMap = map == null;797 if (noMap) {798 createMapFrame(layer, viewport);799 }800 layer.hookUpMapView();801 821 getLayerManager().addLayer(layer); 802 if ( noMap) {822 if (map != null) { 803 823 Main.map.setVisible(true); 804 824 } else if (viewport != null) { -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r10378 r10391 651 651 } 652 652 } 653 } );653 }, true); 654 654 // FIXME: why do we need this? Without this, if you add a WMS layer and do not move the mouse, sometimes, tiles do not 655 655 // start loading. -
trunk/src/org/openstreetmap/josm/gui/layer/LayerManager.java
r10313 r10391 149 149 insertLayerAt(layer, position); 150 150 fireLayerAdded(layer); 151 layer.hookUpMapView(); // needs to be after fireLayerAdded 151 152 } 152 153
Note:
See TracChangeset
for help on using the changeset viewer.