public static void applyBlacklist(ArrayList<String> blacklist){
  ArrayList<Pattern> patterns=new ArrayList<Pattern>();
  for (  String regex : blacklist) {
    patterns.add(Pattern.compile(regex));
  }
  for (  Pattern p : patterns) {
    for (    String key : new TreeSet<String>(backgroundServerList.keySet())) {
      TileLayerServer osmts=backgroundServerList.get(key);
      Matcher m=p.matcher(osmts.tileUrl);
      if (m.find()) {
        backgroundServerList.remove(key);
        if (cachedBackground != null && cachedBackground.equals(osmts)) {
          cachedBackground=null;
        }
        Log.d("OpenStreetMapTileServer","Removed background tile layer " + key);
      }
    }
    for (    String key : new TreeSet<String>(overlayServerList.keySet())) {
      TileLayerServer osmts=overlayServerList.get(key);
      Matcher m=p.matcher(osmts.tileUrl);
      if (m.find()) {
        overlayServerList.remove(key);
        if (cachedOverlay != null && cachedOverlay.equals(osmts)) {
          cachedOverlay=null;
        }
        Log.d("OpenStreetMapTileServer","Removed overlay tile layer " + key);
      }
    }
  }
}

public static void applyBlacklist ( ArrayList < String > blacklist ) { ArrayList < Pattern > patterns = new ArrayList < Pattern > ( ) ; for ( String regex : blacklist ) { patterns . add ( Pattern . compile ( regex ) ) ; } for ( Pattern p : patterns ) { for ( String key : new TreeSet < String > ( backgroundServerList . keySet ( ) ) ) { TileLayerServer osmts = backgroundServerList . get ( key ) ; Matcher m = p . matcher ( osmts . tileUrl ) ; if ( m . find ( ) ) { backgroundServerList . remove ( key ) ; if ( cachedBackground != null && cachedBackground . equals ( osmts ) ) { cachedBackground = null ; } Log . d ( "OpenStreetMapTileServer" , "Removed background tile layer " + key ) ; } } for ( String key : new TreeSet < String > ( overlayServerList . keySet ( ) ) ) { TileLayerServer osmts = overlayServerList . get ( key ) ; Matcher m = p . matcher ( osmts . tileUrl ) ; if ( m . find ( ) ) { overlayServerList . remove ( key ) ; if ( cachedOverlay != null && cachedOverlay . equals ( osmts ) ) { cachedOverlay = null ; } Log . d ( "OpenStreetMapTileServer" , "Removed overlay tile layer " + key ) ; } } } }
remove all background and overlay entries that match the supplied blacklist
