Changeset 19928 in osm for applications/editors/josm
- Timestamp:
- 2010-02-07T23:49:38+01:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePlugin.java
r19894 r19928 23 23 import org.openstreetmap.josm.gui.MapFrame; 24 24 import org.openstreetmap.josm.gui.IconToggleButton; 25 import org.openstreetmap.josm.gui.layer.Layer; 25 26 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; 26 27 import org.openstreetmap.josm.plugins.Plugin; … … 296 297 } 297 298 299 /** 300 * Adds the WMSLayer following this rule:<br/> 301 * - if a WMSLayer exists place this new layer just before this layer<br/> 302 * - Otherwise place it at the bottom 303 * @param wmsLayer the wmsLayer to add 304 */ 305 public static void addWMSLayer(WMSLayer wmsLayer) { 306 if (Main.map != null && Main.map.mapView != null) { 307 int wmsNewLayerPos = Main.map.mapView.getAllLayers().size(); 308 for(Layer l : Main.map.mapView.getLayersOfType(WMSLayer.class)) { 309 int wmsPos = Main.map.mapView.getLayerPos(l); 310 if (wmsPos < wmsNewLayerPos) wmsNewLayerPos = wmsPos; 311 } 312 Main.main.addLayer(wmsLayer); 313 // Move the layer to its new position 314 Main.map.mapView.moveLayer(wmsLayer, wmsNewLayerPos); 315 } else 316 Main.main.addLayer(wmsLayer); 317 } 318 298 319 private static String checkSourceMillesime() { 299 320 java.util.Calendar calendar = java.util.Calendar.getInstance(); … … 313 334 return src; 314 335 } 336 315 337 } -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionLoadFromCache.java
r18720 r19928 75 75 // create layer and load cache 76 76 WMSLayer wmsLayer = new WMSLayer("", "", Integer.parseInt(ext)-1); 77 if (wmsLayer.getCacheControl().loadCache(file, layoutZone)) 78 Main.main.addLayer(wmsLayer);79 77 if (wmsLayer.getCacheControl().loadCache(file, layoutZone)) { 78 CadastrePlugin.addWMSLayer(wmsLayer); 79 } 80 80 } 81 81 } -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java
r19267 r19928 85 85 zone = ((UTM_20N_France_DOM)Main.proj).getCurrentGeodesic(); 86 86 wmsLayer = new WMSLayer(location, codeCommune, zone); 87 Main.main.addLayer(wmsLayer);87 CadastrePlugin.addWMSLayer(wmsLayer); 88 88 System.out.println("Add new layer with Location:" + inputTown.getText()); 89 89 } else if (existingLayers != null && existingLayers.size() > 0 && Main.map.mapView.getActiveLayer() instanceof WMSLayer) {
Note:
See TracChangeset
for help on using the changeset viewer.