Changeset 35421 in osm for applications
- Timestamp:
- 2020-04-11T08:43:09+02:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/TemplatedTMSTileSource.java
r35420 r35421 157 157 break; 158 158 case "switch:": 159 replacement = randomParts[rand.nextInt(randomParts.length)];159 replacement = getRandomPart(randomParts); 160 160 break; 161 161 default: … … 164 164 replacement = Integer.toString((inverse_zoom ? -1 * zoom : zoom) + zoom_offset); 165 165 } else if (PATTERN_SWITCH.matcher("{" + matcher.group(1) + "}").matches()) { 166 replacement = randomParts[rand.nextInt(randomParts.length)];166 replacement = getRandomPart(randomParts); 167 167 } else { 168 168 replacement = '{' + matcher.group(1) + '}'; … … 173 173 matcher.appendTail(url); 174 174 return url.toString().replace(" ", "%20"); 175 } 176 177 protected String getRandomPart(final String[] parts) { 178 return parts[rand.nextInt(parts.length)]; 175 179 } 176 180
Note:
See TracChangeset
for help on using the changeset viewer.