Changeset 34417 in osm for applications/editors


Ignore:
Timestamp:
2018-07-12T04:29:00+02:00 (6 years ago)
Author:
renerr18
Message:

Added leading zeros to Browse image url.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/MicrosoftStreetside/src/org/openstreetmap/josm/plugins/streetside/utils/StreetsideURL.java

    r34416 r34417  
    164164                                throw new IllegalArgumentException("The image id may not be null!");
    165165                        }
    166                         return StreetsideURL.string2URL(MessageFormat.format("{0}{1}{2}{3}{4}",VirtualEarth.BASE_URL_PREFIX, "0", id, "0101", VirtualEarth.BASE_URL_SUFFIX));
     166
     167                        StringBuilder modifiedId = new StringBuilder();
     168
     169      // pad thumbnail imagery with leading zeros
     170      if (id.length() < 16) {
     171        for (int i = 0; i < 16 - id.length(); i++) {
     172          modifiedId.append("0");
     173        }
     174      }
     175      modifiedId.append(id).append("01");
     176
     177                        return StreetsideURL.string2URL(MessageFormat.format("{0}{1}{2}",VirtualEarth.BASE_URL_PREFIX, modifiedId.toString(), VirtualEarth.BASE_URL_SUFFIX));
    167178                }
    168179
Note: See TracChangeset for help on using the changeset viewer.