forked from MapComplete/MapComplete
Refactoring: introduce 'isPrivileged'
This commit is contained in:
parent
6ca055cf28
commit
f405116bb1
11 changed files with 29 additions and 28 deletions
|
@ -242,4 +242,16 @@ export default class Constants {
|
|||
(window.devicePixelRatio && window.devicePixelRatio >= 2)
|
||||
)
|
||||
}
|
||||
|
||||
private static priviligedLayerSet = new Set<string>(Constants.priviliged_layers)
|
||||
|
||||
public static isPriviliged(layer: string | { id: string }) {
|
||||
let id: string
|
||||
if (typeof layer === "string") {
|
||||
id = layer
|
||||
} else {
|
||||
id = layer.id
|
||||
}
|
||||
return this.priviligedLayerSet.has(id)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue