Changeset 9613 in josm for trunk/src/org


Ignore:
Timestamp:
2016-01-24T15:14:26+01:00 (9 years ago)
Author:
stoecker
Message:

fix #12437 - see #12425 - fix handling of equal no tile headers with different values - hope the related josm config change does not break anything

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java

    r9610 r9613  
    219219        @pref String icon;
    220220        @pref String description;
    221         @pref Map<String, String> noTileHeaders;
    222         @pref Map<String, String> noTileChecksums;
     221        @pref Map<String, List<String>> noTileHeaders;
     222        @pref Map<String, List<String>> noTileChecksums;
    223223        @pref int tileSize = OsmMercator.DEFAUL_TILE_SIZE;
    224224        @pref Map<String, String> metadataHeaders;
     
    976976     *
    977977     * @param noTileHeaders Map of &lt;header name, header value&gt; which will be treated as "no tile at this zoom level"
    978      * @since 8344
    979      */
    980     public void setNoTileHeaders(Map<String, String> noTileHeaders) {
     978     * @since 9611
     979     */
     980    public void setNoTileHeaders(Map<String, List<String>> noTileHeaders) {
    981981       this.noTileHeaders = noTileHeaders;
    982982    }
    983983
    984984    @Override
    985     public Map<String, String> getNoTileHeaders() {
     985    public Map<String, List<String>> getNoTileHeaders() {
    986986        return noTileHeaders;
    987987    }
     
    992992     *
    993993     * @param noTileChecksums Map of &lt;checksum type, checksum value&gt; which will be treated as "no tile at this zoom level"
    994      * @since 9610
    995      */
    996     public void setNoTileChecksums(Map<String, String> noTileChecksums) {
     994     * @since 9611
     995     */
     996    public void setNoTileChecksums(Map<String, List<String>> noTileChecksums) {
    997997       this.noTileChecksums = noTileChecksums;
    998998    }
    999999
    10001000    @Override
    1001     public Map<String, String> getNoTileChecksums() {
     1001    public Map<String, List<String>> getNoTileChecksums() {
    10021002        return noTileChecksums;
    10031003    }
  • trunk/src/org/openstreetmap/josm/io/imagery/ImageryReader.java

    r9610 r9613  
    9494        private String lang;
    9595        private List<String> projections;
    96         private Map<String, String> noTileHeaders;
    97         private Map<String, String> noTileChecksums;
     96        private Map<String, List<String> > noTileHeaders;
     97        private Map<String, List<String> > noTileChecksums;
    9898        private Map<String, String> metadataHeaders;
    9999
     
    172172                    newState = State.PROJECTIONS;
    173173                } else if ("no-tile-header".equals(qName)) {
    174                     noTileHeaders.put(atts.getValue("name"), atts.getValue("value"));
     174                    String name = atts.getValue("name");
     175                    List<String> l;
     176                    if (noTileHeaders.containsKey(name)) {
     177                        l = noTileHeaders.get(name);
     178                    } else {
     179                        l = new ArrayList<String>();
     180                        noTileHeaders.put(atts.getValue("name"), l);
     181                    }
     182                    l.add(atts.getValue("value"));
    175183                    newState = State.NO_TILE;
    176184                } else if ("no-tile-checksum".equals(qName)) {
    177                     noTileChecksums.put(atts.getValue("type"), atts.getValue("value"));
     185                    String type = atts.getValue("type");
     186                    List<String> l;
     187                    if (noTileChecksums.containsKey(type)) {
     188                        l = noTileChecksums.get(type);
     189                    } else {
     190                        l = new ArrayList<String>();
     191                        noTileChecksums.put(type, l);
     192                    }
     193                    l.add(atts.getValue("value"));
    178194                    newState = State.NO_TILESUM;
    179195                } else if ("metadata-header".equals(qName)) {
Note: See TracChangeset for help on using the changeset viewer.