Changeset 18207 in osm for applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java
- Timestamp:
- 2009-10-18T18:11:09+02:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java
r17089 r18207 16 16 import org.openstreetmap.josm.actions.JosmAction; 17 17 import org.openstreetmap.josm.data.projection.Lambert; 18 import org.openstreetmap.josm.data.projection.LambertCC9Zones; 18 19 import org.openstreetmap.josm.gui.layer.Layer; 19 20 import org.openstreetmap.josm.tools.GBC; … … 34 35 35 36 public WMSLayer addNewLayer(ArrayList<WMSLayer> existingLayers) { 36 if (Main.map == null) { 37 /*if (Main.map == null) { 37 38 JOptionPane.showMessageDialog(Main.parent, 38 39 tr("Open a layer first (GPX, OSM, cache)")); 39 40 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 {*/ 46 42 String location = ""; 47 43 String codeDepartement = ""; … … 78 74 Main.pref.put("cadastrewms.location", location); 79 75 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 } 83 81 } 84 82 } 85 83 // 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); 87 88 Main.main.addLayer(wmsLayer); 88 89 System.out.println("Add new layer with Location:" + inputTown.getText()); … … 95 96 CadastrePlugin.cadastreGrabber.getWmsInterface().resetCookieIfNewLayer(wmsLayer.getName()); 96 97 return wmsLayer; 97 } 98 //} 98 99 } 99 100
Note:
See TracChangeset
for help on using the changeset viewer.
