All sources have id now, so compare by id

Fixes an issue where a source might not compare strictly equal e.g.:
1. custom imagery gets blacklisted and replaced with a
`rendererBackgroundSource.None()`
2. which doesn't strictly === the `rendererBackgroundSource.None()` on the
background pane switcher
3. so the radio button would not appear checked
This commit is contained in:
Bryan Housel
2016-12-04 21:47:46 -05:00
parent a7ac44f6e8
commit aa3c1c8431

View File

@@ -165,9 +165,8 @@ export function rendererBackground(context) {
background.showsLayer = function(d) {
return d === baseLayer.source() ||
(d.id === 'custom' && baseLayer.source().id === 'custom') ||
overlayLayers.some(function(l) { return l.source() === d; });
return d.id === baseLayer.source().id ||
overlayLayers.some(function(layer) { return d.id === layer.source().id; });
};