Fix source filtering for 'custom' and 'none'

This commit is contained in:
Bryan Housel
2020-03-13 14:57:40 -04:00
parent b96eccc67c
commit 5db95d8a89
2 changed files with 4 additions and 3 deletions

View File

@@ -284,8 +284,9 @@ export function rendererBackground(context) {
const currSource = baseLayer.source();
return _imageryIndex.backgrounds.filter(source => {
if (source.isGlobal) return true; // always include imagery with worldwide coverage
if (includeCurrent && currSource === source) return true; // optionally include the current imagery
if (zoom && zoom < 6) return source.isGlobal; // optionally exclude local imagery at low zooms
if (zoom && zoom < 6) return false; // optionally exclude local imagery at low zooms
return visible[source.id]; // include imagery visible in given extent
});
};

View File

@@ -490,7 +490,7 @@ rendererBackgroundSource.Esri = function(data) {
rendererBackgroundSource.None = function() {
var source = rendererBackgroundSource({ id: 'none', template: '' });
var source = rendererBackgroundSource({ id: 'none', template: '', isGlobal: true });
source.name = function() {
@@ -513,7 +513,7 @@ rendererBackgroundSource.None = function() {
rendererBackgroundSource.Custom = function(template) {
var source = rendererBackgroundSource({ id: 'custom', template: template });
var source = rendererBackgroundSource({ id: 'custom', template: template, isGlobal: true });
source.name = function() {