Changeset 13890 in josm
- Timestamp:
- 2018-06-04T20:27:55+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r13828 r13890 14 14 import java.util.Map; 15 15 import java.util.Objects; 16 import java.util.Optional; 16 17 import java.util.Set; 17 18 import java.util.TreeSet; … … 1551 1552 1552 1553 /** 1554 * Determines if this imagery should be transparent. 1553 1555 * @return should this imagery be transparent 1554 1556 */ … … 1558 1560 1559 1561 /** 1560 * 1562 * Sets whether imagery should be transparent. 1561 1563 * @param transparent set to true if imagery should be transparent 1562 1564 */ … … 1566 1568 1567 1569 /** 1570 * Returns minimum tile expiration in seconds. 1568 1571 * @return minimum tile expiration in seconds 1569 1572 */ … … 1573 1576 1574 1577 /** 1575 * Sets minimum tile expiration in seconds 1578 * Sets minimum tile expiration in seconds. 1576 1579 * @param minimumTileExpire minimum tile expiration in seconds 1577 1580 */ 1578 1581 public void setMinimumTileExpire(int minimumTileExpire) { 1579 1582 this.minimumTileExpire = minimumTileExpire; 1580 1583 } 1584 1585 /** 1586 * Get a string representation of this imagery info suitable for the {@code source} changeset tag. 1587 * @return English name, if known 1588 * @since 13890 1589 */ 1590 public String getSourceName() { 1591 if (ImageryType.BING.equals(getImageryType())) { 1592 return "Bing"; 1593 } else { 1594 if (id != null) { 1595 // Retrieve english name, unfortunately not saved in preferences 1596 Optional<ImageryInfo> infoEn = ImageryLayerInfo.allDefaultLayers.stream().filter(x -> id.equals(x.getId())).findAny(); 1597 if (infoEn.isPresent()) { 1598 return infoEn.get().getOriginalName(); 1599 } 1600 } 1601 return getOriginalName(); 1602 } 1581 1603 } 1582 1604 } -
trunk/src/org/openstreetmap/josm/data/imagery/ImageryLayerInfo.java
r13797 r13890 43 43 private final Map<String, ImageryInfo> layerIds = new HashMap<>(); 44 44 /** List of all available default layers */ 45 privatestatic final List<ImageryInfo> defaultLayers = new ArrayList<>();45 static final List<ImageryInfo> defaultLayers = new ArrayList<>(); 46 46 /** List of all available default layers (including mirrors) */ 47 privatestatic final List<ImageryInfo> allDefaultLayers = new ArrayList<>();47 static final List<ImageryInfo> allDefaultLayers = new ArrayList<>(); 48 48 /** List of all layer ids of available default layers (including mirrors) */ 49 privatestatic final Map<String, ImageryInfo> defaultLayerIds = new HashMap<>();49 static final Map<String, ImageryInfo> defaultLayerIds = new HashMap<>(); 50 50 51 51 private static final String[] DEFAULT_LAYER_SITES = { -
trunk/src/org/openstreetmap/josm/gui/MapView.java
r13652 r13890 43 43 import org.openstreetmap.josm.data.ViewportData; 44 44 import org.openstreetmap.josm.data.coor.EastNorth; 45 import org.openstreetmap.josm.data.imagery.ImageryInfo;46 45 import org.openstreetmap.josm.data.osm.DataSelectionListener; 47 46 import org.openstreetmap.josm.data.osm.event.SelectionEventManager; … … 828 827 for (final ImageryLayer i : layerManager.getLayersOfType(ImageryLayer.class)) { 829 828 if (i.isVisible()) { 830 layerInfo.add( ImageryInfo.ImageryType.BING.equals(i.getInfo().getImageryType()) ? "Bing" : i.getName());829 layerInfo.add(i.getInfo().getSourceName()); 831 830 } 832 831 }
Note:
See TracChangeset
for help on using the changeset viewer.