- Timestamp:
- 2011-10-07T18:52:05+02:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r4464 r4492 76 76 private List<String> serverProjections; 77 77 private String attributionText; 78 private String attributionLinkURL; 78 79 private String attributionImage; 79 private String attributionLinkURL; 80 private String attributionImageURL; 81 private String termsOfUseText; 80 82 private String termsOfUseURL; 81 83 private String countryCode = ""; … … 91 93 @pref String attribution_url; 92 94 @pref String logo_image; 95 @pref String logo_url; 96 @pref String terms_of_use_text; 93 97 @pref String terms_of_use_url; 94 98 @pref String country_code = ""; … … 112 116 attribution_url = i.attributionLinkURL; 113 117 logo_image = i.attributionImage; 118 logo_url = i.attributionImageURL; 119 terms_of_use_text = i.termsOfUseText; 114 120 terms_of_use_url = i.termsOfUseURL; 115 121 country_code = i.countryCode; … … 204 210 } 205 211 attributionText = e.attribution_text; 212 attributionLinkURL = e.attribution_url; 206 213 attributionImage = e.logo_image; 207 attributionLinkURL = e.attribution_url; 214 attributionImageURL = e.logo_url; 215 termsOfUseText = e.terms_of_use_text; 208 216 termsOfUseURL = e.terms_of_use_url; 209 217 countryCode = e.country_code; … … 267 275 this.eulaAcceptanceRequired = null; 268 276 this.bounds = i.bounds; 277 this.attributionText = i.attributionText; 278 this.attributionLinkURL = i.attributionLinkURL; 269 279 this.attributionImage = i.attributionImage; 270 this.attribution LinkURL = i.attributionLinkURL;271 this. attributionText = i.attributionText;280 this.attributionImageURL = i.attributionImageURL; 281 this.termsOfUseText = i.termsOfUseText; 272 282 this.termsOfUseURL = i.termsOfUseURL; 273 283 this.serverProjections = i.serverProjections; … … 327 337 } 328 338 339 public void setAttributionImageURL(String text) { 340 attributionImageURL = text; 341 } 342 329 343 public String getAttributionLinkURL() { 330 344 return attributionLinkURL; … … 333 347 public void setAttributionLinkURL(String text) { 334 348 attributionLinkURL = text; 349 } 350 351 public void setTermsOfUseText(String text) { 352 termsOfUseText = text; 335 353 } 336 354 … … 514 532 { 515 533 this.attributionImage = i.attributionImage; 534 this.attributionImageURL = i.attributionImageURL; 535 this.attributionText = i.attributionText; 516 536 this.attributionLinkURL = i.attributionLinkURL; 517 this. attributionText = i.attributionText;537 this.termsOfUseText = i.termsOfUseText; 518 538 this.termsOfUseURL = i.termsOfUseURL; 519 539 } 520 540 521 public void setAttribution(TMSTileSource s) 522 { 523 if(attributionLinkURL != null) { 524 if(attributionLinkURL.equals("osm")) 541 /** 542 * Applies the attribution from this object to a TMSTileSource. 543 */ 544 public void setAttribution(TMSTileSource s) { 545 if (attributionText != null) { 546 if (attributionText.equals("osm")) { 547 s.setAttributionText(new Mapnik().getAttributionText(0, null, null)); 548 } else { 549 s.setAttributionText(attributionText); 550 } 551 } 552 if (attributionLinkURL != null) { 553 if (attributionLinkURL.equals("osm")) { 525 554 s.setAttributionLinkURL(new Mapnik().getAttributionLinkURL()); 526 else555 } else { 527 556 s.setAttributionLinkURL(attributionLinkURL); 528 } 529 if(attributionText != null) { 530 if(attributionText.equals("osm")) 531 s.setAttributionText(new Mapnik().getAttributionText(0, null, null)); 532 else 533 s.setAttributionText(attributionText); 534 } 535 if(attributionImage != null) { 557 } 558 } 559 if (attributionImage != null) { 536 560 ImageIcon i = ImageProvider.getIfAvailable(null, attributionImage); 537 if (i != null)561 if (i != null) { 538 562 s.setAttributionImage(i.getImage()); 539 } 540 if(termsOfUseURL != null) { 541 if(termsOfUseURL.equals("osm")) 563 } 564 } 565 if (attributionImageURL != null) { 566 s.setAttributionImageURL(attributionImageURL); 567 } 568 if (termsOfUseText != null) { 569 s.setTermsOfUseText(termsOfUseText); 570 } 571 if (termsOfUseURL != null) { 572 if (termsOfUseURL.equals("osm")) { 542 573 s.setTermsOfUseURL(new Mapnik().getTermsOfUseURL()); 543 else574 } else { 544 575 s.setTermsOfUseURL(termsOfUseURL); 576 } 545 577 } 546 578 } -
trunk/src/org/openstreetmap/josm/gui/bbox/SlippyMapBBoxChooser.java
r4489 r4492 71 71 @Override public String getTileUrl(int zoom, int tilex, int tiley) throws IOException { return source.getTileUrl(zoom, tilex, tiley); } 72 72 73 @Override public boolean requiresAttribution() { return source.requiresAttribution(); } 74 75 @Override public String getAttributionText(int zoom, Coordinate topLeft, Coordinate botRight) { return source.getAttributionText(zoom, topLeft, botRight); } 76 77 @Override public String getAttributionLinkURL() { return source.getAttributionLinkURL(); } 78 73 79 @Override public Image getAttributionImage() { return source.getAttributionImage(); } 74 80 75 @Override public String getAttributionText(int zoom, Coordinate topLeft, Coordinate botRight) { return source.getAttributionText(zoom, topLeft, botRight); } 76 77 @Override public boolean requiresAttribution() { return source.requiresAttribution(); } 78 79 @Override public String getAttributionLinkURL() { return source.getAttributionLinkURL(); } 81 @Override public String getAttributionImageURL() { return source.getAttributionImageURL(); } 82 83 @Override public String getTermsOfUseText() { return source.getTermsOfUseText(); } 80 84 81 85 @Override public String getTermsOfUseURL() { return source.getTermsOfUseURL(); } -
trunk/src/org/openstreetmap/josm/gui/layer/TMSLayer.java
r4489 r4492 1171 1171 int otherZooms[] = { -1, 1, -2, 2, -3, -4, -5}; 1172 1172 for (int zoomOffset : otherZooms) { 1173 if (!autoZoom) 1173 if (!autoZoom) { 1174 1174 break; 1175 } 1175 1176 int newzoom = displayZoomLevel + zoomOffset; 1176 if (newzoom < MIN_ZOOM) 1177 if (newzoom < MIN_ZOOM) { 1177 1178 continue; 1179 } 1178 1180 if (missedTiles.size() <= 0) { 1179 1181 break; … … 1237 1239 myDrawString(g, tr("Best zoom: {0}", Math.log(getScaleFactor(1))/Math.log(2)/2+1), 50, 185); 1238 1240 }*/ 1239 } // end of paint method1241 } 1240 1242 1241 1243 /** -
trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java
r4432 r4492 302 302 } 303 303 304 305 304 /** 306 305 * … … 312 311 return new EastNorth((xIndex * imageSize) / info.getPixelPerDegree(), (yIndex * imageSize) / info.getPixelPerDegree()); 313 312 } 314 315 313 316 314 protected void downloadAndPaintVisible(Graphics g, final MapView mv, boolean real){ -
trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java
r4439 r4492 253 253 entry.setAttributionImage(accumulator.toString()); 254 254 } else if (qName.equals("logo-url")) { 255 // TODO: it should be possible to specify the link for the logo255 entry.setAttributionImageURL(accumulator.toString()); 256 256 } else if (qName.equals("terms-of-use-text")) { 257 // TODO: it should be possible to configure the terms of use display text257 entry.setTermsOfUseText(accumulator.toString()); 258 258 } else if (qName.equals("terms-of-use-url")) { 259 259 entry.setTermsOfUseURL(accumulator.toString());
Note:
See TracChangeset
for help on using the changeset viewer.