Hide background sources from the list if they're blocked (close #7905)

This commit is contained in:
Quincy Morgan
2020-09-03 12:30:59 -04:00
parent 15078bd39c
commit a72a2bb860
5 changed files with 30 additions and 21 deletions
+6 -6
View File
@@ -23,8 +23,8 @@ var oauth = osmAuth({
loading: authLoading,
done: authDone
});
var _blacklists = ['.*\.google(apis)?\..*/(vt|kh)[\?/].*([xyz]=.*){3}.*'];
// hardcode default block of Google Maps
var _imageryBlocklists = ['.*\.google(apis)?\..*/(vt|kh)[\?/].*([xyz]=.*){3}.*'];
var _tileCache = { toLoad: {}, loaded: {}, inflight: {}, seen: {}, rtree: new RBush() };
var _noteCache = { toLoad: {}, loaded: {}, inflight: {}, inflightPost: {}, note: {}, closed: {}, rtree: new RBush() };
var _userCache = { toLoad: {}, user: {} };
@@ -919,7 +919,7 @@ export default {
return callback(err, null);
}
// update blacklists
// update blocklists
var elements = xml.getElementsByTagName('blacklist');
var regexes = [];
for (var i = 0; i < elements.length; i++) {
@@ -929,7 +929,7 @@ export default {
}
}
if (regexes.length) {
_blacklists = regexes;
_imageryBlocklists = regexes;
}
if (_rateLimitError) {
@@ -1321,8 +1321,8 @@ export default {
},
imageryBlacklists: function() {
return _blacklists;
imageryBlocklists: function() {
return _imageryBlocklists;
},