Ignore:
Timestamp:
2009-10-18T18:11:09+02:00 (16 years ago)
Author:
pieren
Message:

Use the new cadastre projection LambertCC9Zones

File:
1 edited

Legend:

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

    r17089 r18207  
    1616import org.openstreetmap.josm.actions.JosmAction;
    1717import org.openstreetmap.josm.data.projection.Lambert;
     18import org.openstreetmap.josm.data.projection.LambertCC9Zones;
    1819import org.openstreetmap.josm.gui.layer.Layer;
    1920import org.openstreetmap.josm.tools.GBC;
     
    3435
    3536    public WMSLayer addNewLayer(ArrayList<WMSLayer> existingLayers) {
    36         if (Main.map == null) {
     37        /*if (Main.map == null) {
    3738            JOptionPane.showMessageDialog(Main.parent,
    3839                    tr("Open a layer first (GPX, OSM, cache)"));
    3940            return null;
    40             /*
    41         } else if (existingLayers != null && existingLayers.size() > 0) {
    42             JOptionPane.showMessageDialog(Main.parent,
    43                     tr("Select one cadastre layer first"));
    44             return null;*/
    45         } else {
     41        } else {*/
    4642            String location = "";
    4743            String codeDepartement = "";
     
    7874                Main.pref.put("cadastrewms.location", location);
    7975                Main.pref.put("cadastrewms.codeCommune", codeCommune);
    80                 for (Layer l : Main.map.mapView.getAllLayers()) {
    81                     if (l instanceof WMSLayer && l.getName().equalsIgnoreCase(location + codeDepartement)) {
    82                         return null;
     76                if (Main.map != null) {
     77                    for (Layer l : Main.map.mapView.getAllLayers()) {
     78                        if (l instanceof WMSLayer && l.getName().equalsIgnoreCase(location + codeDepartement)) {
     79                            return null;
     80                        }
    8381                    }
    8482                }
    8583                // add the layer if it doesn't exist
    86                 wmsLayer = new WMSLayer(location, codeCommune, Lambert.layoutZone);
     84                if (Main.proj instanceof LambertCC9Zones)
     85                    wmsLayer = new WMSLayer(location, codeCommune, LambertCC9Zones.layoutZone);
     86                else
     87                    wmsLayer = new WMSLayer(location, codeCommune, Lambert.layoutZone);
    8788                Main.main.addLayer(wmsLayer);
    8889                System.out.println("Add new layer with Location:" + inputTown.getText());
     
    9596                CadastrePlugin.cadastreGrabber.getWmsInterface().resetCookieIfNewLayer(wmsLayer.getName());
    9697            return wmsLayer;
    97         }
     98        //}
    9899    }
    99100
Note: See TracChangeset for help on using the changeset viewer.