Changeset 32022 in osm for applications
- Timestamp:
- 2016-01-24T15:12:38+01:00 (9 years ago)
- Location:
- applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractTMSTileSource.java
r32021 r32022 28 28 protected String baseUrl; 29 29 protected String id; 30 private final Map<String, String> noTileHeaders;31 private final Map<String, String> noTileChecksums;30 private final Map<String, List<String> > noTileHeaders; 31 private final Map<String, List<String> > noTileChecksums; 32 32 private final Map<String, String> metadataHeaders; 33 33 protected int tileSize; … … 212 212 public boolean isNoTileAtZoom(Map<String, List<String>> headers, int statusCode, byte[] content) { 213 213 if (noTileHeaders != null && headers != null) { 214 for (Entry<String, String> searchEntry: noTileHeaders.entrySet()) {214 for (Entry<String, List<String>> searchEntry: noTileHeaders.entrySet()) { 215 215 List<String> headerVals = headers.get(searchEntry.getKey()); 216 216 if (headerVals != null) { 217 217 for (String headerValue: headerVals) { 218 if (headerValue.matches(searchEntry.getValue())) { 219 return true; 218 for (String val: searchEntry.getValue()) { 219 if (headerValue.matches(val)) { 220 return true; 221 } 220 222 } 221 223 } … … 224 226 } 225 227 if (noTileChecksums != null) { 226 for (Entry<String, String> searchEntry: noTileChecksums.entrySet()) {228 for (Entry<String, List<String>> searchEntry: noTileChecksums.entrySet()) { 227 229 MessageDigest md = null; 228 230 try { … … 242 244 hexChars[j++] = (char)(vn + (vn >= 10 ? 'a'-10 : '0')); 243 245 } 244 if (new String(hexChars).equalsIgnoreCase(searchEntry.getValue())) { 245 return true; 246 for (String val: searchEntry.getValue()) { 247 if (new String(hexChars).equalsIgnoreCase(val)) { 248 return true; 249 } 246 250 } 247 251 } -
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/TileSourceInfo.java
r32021 r32022 2 2 package org.openstreetmap.gui.jmapviewer.tilesources; 3 3 4 import java.util.List; 4 5 import java.util.Map; 5 6 … … 22 23 23 24 /** headers meaning, that there is no tile at this zoom level */ 24 protected Map<String, String> noTileHeaders;25 protected Map<String, List<String>> noTileHeaders; 25 26 26 27 /** checksum of empty tiles */ 27 protected Map<String, String> noTileChecksums;28 protected Map<String, List<String>> noTileChecksums; 28 29 29 30 /** minimum zoom level supported by the tile source */ … … 99 100 * Request header information for empty tiles for servers delivering such tile types 100 101 * @return map of headers, that when set, means that this is "no tile at this zoom level" situation 102 * @since 32022 101 103 */ 102 public Map<String, String> getNoTileHeaders() {104 public Map<String, List<String>> getNoTileHeaders() { 103 105 return noTileHeaders; 104 106 } … … 107 109 * Checkusm for empty tiles for servers delivering such tile types 108 110 * @return map of checksums, that when detected, means that this is "no tile at this zoom level" situation 109 * @since 3202 1111 * @since 32022 110 112 */ 111 public Map<String, String> getNoTileChecksums() {113 public Map<String, List<String>> getNoTileChecksums() { 112 114 return noTileChecksums; 113 115 }
Note:
See TracChangeset
for help on using the changeset viewer.