diff --git a/src/Models/ThemeViewState.ts b/src/Models/ThemeViewState.ts index 7a7ea4f50d..03c0c2261f 100644 --- a/src/Models/ThemeViewState.ts +++ b/src/Models/ThemeViewState.ts @@ -155,6 +155,10 @@ export default class ThemeViewState implements SpecialVisualizationState { public readonly geocodedImages: UIEventSource = new UIEventSource([]) public readonly searchState: SearchState + /** + * Used to check in the download panel if used + */ + public readonly featureSummary: SummaryTileSourceRewriter constructor(layout: LayoutConfig, mvtAvailableLayers: Set) { Utils.initDomPurify() @@ -356,6 +360,7 @@ export default class ThemeViewState implements SpecialVisualizationState { bounds: this.visualFeedbackViewportBounds, }, ) + this.featureSummary = this.setupSummaryLayer() this.hasDataInView = new NoElementsInViewDetector(this).hasFeatureInView this.imageUploadManager = new ImageUploadManager( layout, @@ -785,7 +790,7 @@ export default class ThemeViewState implements SpecialVisualizationState { ), current_view: this.currentView, favourite: this.favourites, - summary: this.setupSummaryLayer(), + summary: this.featureSummary, last_click: this.lastClickObject, search: this.searchState.locationResults, } diff --git a/src/UI/DownloadFlow/DownloadPanel.svelte b/src/UI/DownloadFlow/DownloadPanel.svelte index 428eae6c7f..0be2d6d480 100644 --- a/src/UI/DownloadFlow/DownloadPanel.svelte +++ b/src/UI/DownloadFlow/DownloadPanel.svelte @@ -22,7 +22,7 @@ let metaIsIncluded = false - let numberOfFeatures = state.featureSummary.totalNumberOfFeatures + let numberOfFeatures = state.featureSummary?.totalNumberOfFeatures async function getGeojson() { await state.indexedFeatures.downloadAll()