Changeset 3934 in josm for trunk/src/org/openstreetmap/josm/data/imagery
- Timestamp:
- 2011-02-26T00:35:10+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/imagery/ImageryInfo.java
r3878 r3934 4 4 import java.util.ArrayList; 5 5 import java.util.Collection; 6 7 import org.openstreetmap.josm.io.OsmApi; 6 8 7 9 /** … … 27 29 } 28 30 } 29 30 private final static String[] BLACKLIST_REGEXES = {31 // These entries are for Google tile servers (names and IPV4 numbers)32 ".*\\.google\\.com/.*",33 ".*209\\.85\\.2\\d\\d.*",34 ".*209\\.85\\.1[3-9]\\d.*",35 ".*209\\.85\\.12[89].*"36 };37 31 38 32 String name; … … 43 37 double pixelPerDegree = 0.0; 44 38 int maxZoom = 0; 45 private boolean blacklisted = false;46 39 47 40 public ImageryInfo(String name) { … … 173 166 public void setUrl(String url) { 174 167 175 // determine if URL is on blacklist and flag accordingly.176 blacklisted = false;177 for (String blacklistRegex : BLACKLIST_REGEXES) {178 if (url.matches(blacklistRegex)) {179 blacklisted = true;180 System.err.println("layer '" + name + "' uses blacklisted URL");181 break;182 }183 }184 185 168 for (ImageryType type : ImageryType.values()) { 186 169 if (url.startsWith(type.getUrlString() + ":")) { … … 252 235 } 253 236 237 /** 238 * Returns true if this layer's URL is matched by one of the regular 239 * expressions kept by the current OsmApi instance. 240 */ 254 241 public boolean isBlacklisted() { 255 return blacklisted;242 return OsmApi.getOsmApi().getCapabilities().isOnImageryBlacklist(this.url); 256 243 } 257 244 }
Note:
See TracChangeset
for help on using the changeset viewer.