Ignore:
Timestamp:
2009-11-28T17:05:44+01:00 (16 years ago)
Author:
pieren
Message:

Fix minor issues if Grab is called without layer (possible since projection rework)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSVectorImage.java

    r18544 r18838  
    88import org.openstreetmap.josm.Main;
    99import org.openstreetmap.josm.data.Bounds;
    10 import org.openstreetmap.josm.data.projection.LambertCC9Zones;
    1110import org.openstreetmap.josm.gui.MapView;
    1211import org.openstreetmap.josm.gui.PleaseWaitRunnable;
     
    3231        try {
    3332            if (grabber.getWmsInterface().retrieveInterface(wmsLayer)) {
     33                boolean useFactor = true;
    3434                if (wmsLayer.images.isEmpty()) {
    3535                    // first time we grab an image for this layer
    3636                    if (CacheControl.cacheEnabled) {
    3737                        if (wmsLayer.getCacheControl().loadCacheIfExist()) {
    38                             Main.map.mapView.repaint();
     38                            Main.map.mapView.zoomTo(wmsLayer.getCommuneBBox().toBounds());
     39                            //Main.map.mapView.repaint();
    3940                            return;
    4041                        }
     
    4647                        // set vectorized commune bounding box by opening the standard web window
    4748                        grabber.getWmsInterface().retrieveCommuneBBox(wmsLayer);
    48                         // if it is the first layer, use the communeBBox as grab bbox
    49                         if (Main.proj instanceof LambertCC9Zones && Main.map.mapView.getAllLayers().size() == 1 ) {
     49                        // if it is the first layer, use the communeBBox as grab bbox (and not divided)
     50                        if (Main.map.mapView.getAllLayers().size() == 1 ) {
    5051                            bounds = wmsLayer.getCommuneBBox().toBounds();
    5152                            Main.map.mapView.zoomTo(bounds);
     53                            useFactor = false;
    5254                        }
    5355                    }
    5456                }
    5557                // grab new images from wms server into active layer
    56                 wmsLayer.grab(grabber, bounds);
     58                wmsLayer.grab(grabber, bounds, useFactor);
    5759            }
    5860        } catch (DuplicateLayerException e) {
Note: See TracChangeset for help on using the changeset viewer.