Formatting

This commit is contained in:
Pieter Vander Vennet 2021-07-07 18:12:07 +02:00
parent caacb6a3ef
commit 37d7040cff
2 changed files with 35 additions and 27 deletions

View file

@ -94,7 +94,7 @@ export default class LayoutConfig {
}
);
this.defaultBackgroundId = json.defaultBackgroundId;
this.layers = LayoutConfig.ExtractLayers(json, context, this.units, official);
this.layers = LayoutConfig.ExtractLayers(json, this.units, official);
// ALl the layers are constructed, let them share tags in now!
const roaming: { r, source: LayerConfig }[] = []
@ -158,7 +158,7 @@ export default class LayoutConfig {
}
private static ExtractLayers(json: LayoutConfigJson, context: string, units: Unit[], official: boolean): LayerConfig[] {
private static ExtractLayers(json: LayoutConfigJson, units: Unit[], official: boolean): LayerConfig[] {
const result: LayerConfig[] = []
json.layers.forEach((layer, i) => {

View file

@ -188,9 +188,13 @@ export interface LayoutConfigJson {
* *layers can also remove 'leftover'-features if the leftovers overlap with a feature in the layer itself
*
* Note that builtin layers can be reused. Either put in the name of the layer to reuse, or use {builtin: "layername", override: ...}
*
* The 'override'-object will be copied over the original values of the layer, which allows to change certain aspects of the layer
* ex: If you would like to use layer nature reserves, but only from a specific operator (eg. Natuurpunt) you would use the following in your theme:
* layer: {
*
* For example: If you would like to use layer nature reserves, but only from a specific operator (eg. Natuurpunt) you would use the following in your theme:
*
* ```
* "layer": {
* "builtin": "nature_reserve",
* "override": {"source":
* {"osmTags": {
@ -198,13 +202,17 @@ export interface LayoutConfigJson {
* }
* }
* }
* };
*It's also possible to load multiple layers at once, for example, if you would like for both drinking water and benches to start the zoomlevel at 12, you would use the following:
layer: {
* }
* ```
*
* It's also possible to load multiple layers at once, for example, if you would like for both drinking water and benches to start at the zoomlevel at 12, you would use the following:
*
* ```
* "layer": {
* "builtin": ["benches", "drinking_water"],
* "override": {"minzoom": 12}
* }
*
*```
*/
layers: (LayerConfigJson | string | { builtin: string | string[], override: any })[],