- Timestamp:
- 2012-01-23T18:37:24+01:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r4856 r4861 40 40 41 41 private String urlString; 42 42 43 ImageryType(String urlString) { 43 44 this.urlString = urlString; 44 45 } 46 45 47 public String getUrlString() { 46 48 return urlString; 49 } 50 51 public static ImageryType fromUrlString(String s) { 52 for (ImageryType type : ImageryType.values()) { 53 if (type.getUrlString().equals(s)) { 54 return type; 55 } 56 } 57 return null; 47 58 } 48 59 } … … 180 191 } 181 192 193 public ImageryInfo(String name, String url, String type, String eulaAcceptanceRequired, String cookies) { 194 this.name=name; 195 setExtendedUrl(url); 196 ImageryType t = ImageryType.fromUrlString(type); 197 this.cookies=cookies; 198 if (t != null) { 199 this.imageryType = t; 200 } 201 } 202 182 203 public ImageryInfo(String name, String url, String cookies, double pixelPerDegree) { 183 204 this.name=name; … … 194 215 cookies = e.cookies; 195 216 eulaAcceptanceRequired = e.eula; 196 for (ImageryType type : ImageryType.values()) { 197 if (type.getUrlString().equals(e.type)) { 198 imageryType = type; 199 break; 200 } 201 } 217 imageryType = ImageryType.fromUrlString(e.type); 202 218 if (imageryType == null) throw new IllegalArgumentException("unknown type"); 203 219 pixelPerDegree = e.pixel_per_eastnorth; -
trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControl.java
r3715 r4861 33 33 */ 34 34 static final int protocolMajorVersion = 1; 35 static final int protocolMinorVersion = 2;35 static final int protocolMinorVersion = 3; 36 36 37 37 /** -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImageryHandler.java
r4834 r4861 44 44 String url = args.get("url"); 45 45 String title = args.get("title"); 46 String type = args.get("type"); 46 47 if((title == null) || (title.length() == 0)) 47 48 { … … 49 50 } 50 51 String cookies = args.get("cookies"); 51 ImageryLayer imgLayer = ImageryLayer.create(new ImageryInfo(title, url, cookies));52 ImageryLayer imgLayer = ImageryLayer.create(new ImageryInfo(title, url, type, null, cookies)); 52 53 Main.main.addLayer(imgLayer); 53 54 54 } 55 55
Note:
See TracChangeset
for help on using the changeset viewer.