- Timestamp:
- 2014-08-23T21:26:31+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java
r7425 r7438 239 239 return autoDownloadEnabled; 240 240 } 241 242 public void setAutoDownload(boolean val) { 243 autoDownloadEnabled = val; 244 } 245 246 public boolean isAutoResolution() { 247 return autoResolutionEnabled; 248 } 249 250 public void setAutoResolution(boolean val) { 251 autoResolutionEnabled = val; 252 } 241 253 242 254 public void downloadAreaToCache(PrecacheTask precacheTask, List<LatLon> points, double bufferX, double bufferY) { -
trunk/src/org/openstreetmap/josm/io/session/ImagerySessionExporter.java
r6070 r7438 7 7 import java.util.Collection; 8 8 import java.util.Collections; 9 import java.util.LinkedHashMap; 9 10 import java.util.Map; 10 11 … … 78 79 layerElem.setAttribute("version", "0.1"); 79 80 ImageryPreferenceEntry e = new ImageryPreferenceEntry(layer.getInfo()); 80 Map<String,String> data = Preferences.serializeStruct(e, ImageryPreferenceEntry.class); 81 Map<String,String> data = new LinkedHashMap<>(Preferences.serializeStruct(e, ImageryPreferenceEntry.class)); 82 if (layer instanceof WMSLayer) { 83 WMSLayer wms = (WMSLayer) layer; 84 data.put("automatic-downloading", Boolean.toString(wms.hasAutoDownload())); 85 data.put("automatically-change-resolution", Boolean.toString(wms.isAutoResolution())); 86 } 81 87 for (Map.Entry<String,String> entry : data.entrySet()) { 82 88 Element attrElem = support.createElement(entry.getKey()); -
trunk/src/org/openstreetmap/josm/io/session/ImagerySessionImporter.java
r7005 r7438 13 13 import org.openstreetmap.josm.gui.layer.ImageryLayer; 14 14 import org.openstreetmap.josm.gui.layer.Layer; 15 import org.openstreetmap.josm.gui.layer.WMSLayer; 15 16 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 16 17 import org.openstreetmap.josm.io.IllegalDataException; … … 44 45 ImageryPreferenceEntry prefEntry = Preferences.deserializeStruct(attributes, ImageryPreferenceEntry.class); 45 46 ImageryInfo i = new ImageryInfo(prefEntry); 46 return ImageryLayer.create(i); 47 ImageryLayer layer = ImageryLayer.create(i); 48 if (layer instanceof WMSLayer) { 49 WMSLayer wms = (WMSLayer) layer; 50 String autoDownload = attributes.get("automatic-downloading"); 51 if (autoDownload != null) { 52 wms.setAutoDownload(Boolean.parseBoolean(autoDownload)); 53 } 54 String autoResolution = attributes.get("automatically-change-resolution"); 55 if (autoResolution != null) { 56 wms.setAutoResolution(Boolean.parseBoolean(autoResolution)); 57 } 58 } 59 return layer; 47 60 } 48 61 }
Note:
See TracChangeset
for help on using the changeset viewer.