Changeset 4240 in josm for trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java
- Timestamp:
- 2011-07-14T12:48:27+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java
r4184 r4240 108 108 private int workingThreadCount; 109 109 private boolean canceled; 110 private ArrayList<String> serverProjections = null;110 private List<String> serverProjections = null; 111 111 112 112 /** set to true if this layer uses an invalid base url */ … … 121 121 public WMSLayer(ImageryInfo info) { 122 122 super(info); 123 serverProjections = info.getServerProjections(); 123 124 mv = Main.map.mapView; 124 125 setBackgroundLayer(true); /* set global background variable */ … … 143 144 144 145 if(info.getUrl() != null) { 145 serverProjections = WMSGrabber.getServerProjections(info.getUrl(), true); 146 if (serverProjections == null) { 147 serverProjections = WMSGrabber.getServerProjections(info.getUrl(), true); 148 } 146 149 startGrabberThreads(); 147 150 if(info.getImageryType() == ImageryType.WMS && !ImageryInfo.isUrlWithPatterns(info.getUrl())) { … … 310 313 */ 311 314 public int getBaseImageWidth() { 312 int overlap = (PROP_OVERLAP.get()?PROP_OVERLAP_EAST.get() * imageSize / 100:0);315 int overlap = PROP_OVERLAP.get() ? (PROP_OVERLAP_EAST.get() * imageSize / 100) : 0; 313 316 return imageSize + overlap; 314 317 } … … 319 322 */ 320 323 public int getBaseImageHeight() { 321 int overlap = (PROP_OVERLAP.get()?PROP_OVERLAP_NORTH.get() * imageSize / 100:0);324 int overlap = PROP_OVERLAP.get() ? (PROP_OVERLAP_NORTH.get() * imageSize / 100) : 0; 322 325 return imageSize + overlap; 323 326 } … … 696 699 oos.writeDouble(info.getPixelPerDegree()); 697 700 oos.writeObject(info.getName()); 698 oos.writeObject(info.get FullUrl());701 oos.writeObject(info.getExtendedUrl()); 699 702 oos.writeObject(images); 700 703 oos.close(); … … 735 738 info.setPixelPerDegree(ois.readDouble()); 736 739 doSetName((String)ois.readObject()); 737 info.set Url((String) ois.readObject());740 info.setExtendedUrl((String) ois.readObject()); 738 741 images = (GeorefImage[][])ois.readObject(); 739 742 ois.close(); … … 914 917 } 915 918 919 /** 920 * Get the list of projections supported by the WMS server corresponding to this layer. 921 * @return The list of projections, if known. An empty list otherwise. 922 */ 923 public List<String> getServerProjections() { 924 if (serverProjections == null) 925 return Collections.emptyList(); 926 else 927 return Collections.unmodifiableList(serverProjections); 928 } 929 916 930 @Override 917 931 public boolean isProjectionSupported(Projection proj) {
Note:
See TracChangeset
for help on using the changeset viewer.