Refactoring: rename variable for clarity

This commit is contained in:
Pieter Vander Vennet 2024-04-10 14:09:32 +02:00
parent 8526f4e941
commit 620126d211

View file

@ -95,8 +95,8 @@ export default class LayoutSource extends FeatureSourceMerger {
isLoading.setData(loading) isLoading.setData(loading)
} }
overpassSource?.runningQuery?.addCallbackAndRun((_) => setIsLoading()) overpassSource?.runningQuery?.addCallbackAndRun(() => setIsLoading())
osmApiSource?.isRunning?.addCallbackAndRun((_) => setIsLoading()) osmApiSource?.isRunning?.addCallbackAndRun(() => setIsLoading())
const geojsonSources: UpdatableFeatureSource[] = geojsonlayers.map((l) => const geojsonSources: UpdatableFeatureSource[] = geojsonlayers.map((l) =>
LayoutSource.setupGeojsonSource(l, mapProperties, isDisplayed(l.id)) LayoutSource.setupGeojsonSource(l, mapProperties, isDisplayed(l.id))
@ -122,12 +122,12 @@ export default class LayoutSource extends FeatureSourceMerger {
private static setupGeojsonSource( private static setupGeojsonSource(
layer: LayerConfig, layer: LayerConfig,
mapProperties: { zoom: Store<number>; bounds: Store<BBox> }, mapProperties: { zoom: Store<number>; bounds: Store<BBox> },
isActive?: Store<boolean> isActiveByFilter?: Store<boolean>
): UpdatableFeatureSource { ): UpdatableFeatureSource {
const source = layer.source const source = layer.source
isActive = mapProperties.zoom.map( const isActive = mapProperties.zoom.map(
(z) => (isActive?.data ?? true) && z >= layer.minzoom, (z) => (isActiveByFilter?.data ?? true) && z >= layer.minzoom,
[isActive] [isActiveByFilter]
) )
if (source.geojsonZoomLevel === undefined) { if (source.geojsonZoomLevel === undefined) {
// This is a 'load everything at once' geojson layer // This is a 'load everything at once' geojson layer