diff --git a/src/Logic/Search/LayerSearch.ts b/src/Logic/Search/LayerSearch.ts index 22c01254a4..60ffbacb1e 100644 --- a/src/Logic/Search/LayerSearch.ts +++ b/src/Logic/Search/LayerSearch.ts @@ -1,4 +1,3 @@ -import Constants from "../../Models/Constants" import SearchUtils from "./SearchUtils" import ThemeSearch from "./ThemeSearch" import LayerConfig from "../../Models/ThemeConfig/LayerConfig" @@ -12,7 +11,9 @@ export default class LayerSearch { constructor(layout: LayoutConfig) { this._layout = layout - this._layerWhitelist = new Set(layout.layers.map(l => l.id).filter(id => Constants.added_by_default.indexOf(id) < 0)) + this._layerWhitelist = new Set(layout.layers + .filter(l => l.isNormal()) + .map(l => l.id)) } static scoreLayers(query: string, options: { diff --git a/src/Logic/Search/ThemeSearch.ts b/src/Logic/Search/ThemeSearch.ts index d392275532..30b4d25eb5 100644 --- a/src/Logic/Search/ThemeSearch.ts +++ b/src/Logic/Search/ThemeSearch.ts @@ -36,7 +36,7 @@ export default class ThemeSearch { private readonly _otherThemes: MinimalLayoutInformation[] constructor(state: {osmConnection: OsmConnection, layout: LayoutConfig}) { - this._layersToIgnore = state.layout.layers.map(l => l.id) + this._layersToIgnore = state.layout.layers.filter(l => l.isNormal()).map(l => l.id) this._knownHiddenThemes = UserRelatedState.initDiscoveredHiddenThemes(state.osmConnection).map(list => new Set(list)) this._otherThemes = ThemeSearch.officialThemes.themes .filter(th => th.id !== state.layout.id)