forked from MapComplete/MapComplete
Add maxzoom capability to layers
This commit is contained in:
parent
f0765df5ed
commit
878cb6d47d
5 changed files with 18 additions and 7 deletions
|
@ -71,6 +71,9 @@ export default class FilteringFeatureSource implements FeatureSource {
|
|||
if (l.zoom < layer.layerDef.minzoom) {
|
||||
continue;
|
||||
}
|
||||
if(l.zoom > layer.layerDef.maxzoom){
|
||||
continue;
|
||||
}
|
||||
if (!layer.isDisplayed.data) {
|
||||
continue;
|
||||
}
|
||||
|
@ -102,6 +105,6 @@ export default class FilteringFeatureSource implements FeatureSource {
|
|||
isDisplayed: UIEventSource<boolean>,
|
||||
layerDef: LayerConfig
|
||||
}, location: UIEventSource<Loc>) {
|
||||
return layer.isDisplayed.data && (layer.layerDef.minzoom <= location.data.zoom)
|
||||
return layer.isDisplayed.data && (layer.layerDef.minzoom <= location.data.zoom) && (layer.layerDef.maxzoom >= location.data.zoom)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue