forked from MapComplete/MapComplete
Merge branch 'master' into develop
This commit is contained in:
commit
55741d7043
8 changed files with 134 additions and 32 deletions
|
|
@ -210,7 +210,7 @@ export default class FilteredLayer {
|
|||
* - the specified 'global filters'
|
||||
* - the 'isShown'-filter set by the layer
|
||||
*/
|
||||
public isShown(properties: Record<string, string>, globalFilters?: GlobalFilter[]): boolean {
|
||||
public isShown(properties: Record<string, string>, globalFilters?: GlobalFilter[], zoomlevel?: number): boolean {
|
||||
if (properties._deleted === "yes") {
|
||||
return false
|
||||
}
|
||||
|
|
@ -219,9 +219,10 @@ export default class FilteredLayer {
|
|||
if (neededTags !== undefined) {
|
||||
const doesMatch = neededTags.matchesProperties(properties)
|
||||
if (globalFilter.forceShowOnMatch) {
|
||||
return doesMatch || this.isDisplayed.data
|
||||
}
|
||||
if (!doesMatch) {
|
||||
if(doesMatch){
|
||||
return true
|
||||
}
|
||||
} else if (!doesMatch) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
|
@ -240,6 +241,10 @@ export default class FilteredLayer {
|
|||
}
|
||||
}
|
||||
|
||||
if(zoomlevel !== undefined && (this.layerDef.minzoom > zoomlevel || this.layerDef.minzoomVisible < zoomlevel)){
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ export default class LayerConfig extends WithContextLoader {
|
|||
if (json["minZoom"] !== undefined) {
|
||||
throw "At " + context + ": minzoom is written all lowercase"
|
||||
}
|
||||
this.minzoomVisible = json.minzoomVisible ?? this.minzoom
|
||||
this.minzoomVisible = json.minzoomVisible ?? 100
|
||||
this.shownByDefault = json.shownByDefault ?? true
|
||||
this.doCount = json.isCounted ?? this.shownByDefault ?? true
|
||||
this.forceLoad = json.forceLoad ?? false
|
||||
|
|
|
|||
|
|
@ -473,7 +473,10 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
|||
fs.layer,
|
||||
fs,
|
||||
(id) => this.featureProperties.getStore(id),
|
||||
this.layerState.globalFilters
|
||||
this.layerState.globalFilters,
|
||||
undefined,
|
||||
this.mapProperties.zoom,
|
||||
this.selectedElement
|
||||
)
|
||||
filteringFeatureSource.set(layerName, filtered)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue