2020-08-30 01:13:18 +02:00
|
|
|
import {TagRenderingConfigJson} from "./TagRenderingConfigJson";
|
|
|
|
import {AndOrTagConfigJson} from "./TagConfigJson";
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Configuration for a single layer
|
|
|
|
*/
|
|
|
|
export interface LayerConfigJson {
|
|
|
|
/**
|
|
|
|
* The id of this layer.
|
|
|
|
* This should be a simple, lowercase, human readable string that is used to identify the layer.
|
|
|
|
*/
|
|
|
|
id: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The name of this layer
|
|
|
|
* Used in the layer control panel and the 'Personal theme'
|
|
|
|
*/
|
|
|
|
name: string | any
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A description for this layer.
|
|
|
|
* Shown in the layer selections and in the personal theme
|
|
|
|
*/
|
|
|
|
description?: string | any;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The tags to load from overpass. Either a simple 'key=value'-string, otherwise an advanced configuration
|
|
|
|
*/
|
|
|
|
overpassTags: AndOrTagConfigJson | string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The zoomlevel at which point the data is shown and loaded.
|
|
|
|
*/
|
|
|
|
minzoom: number;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The title shown in a popup for elements of this layer
|
|
|
|
*/
|
2020-09-03 00:00:37 +02:00
|
|
|
title: string | TagRenderingConfigJson;
|
2020-08-30 01:13:18 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The icon for an element.
|
|
|
|
* Note that this also doubles as the icon for this layer (rendered with the overpass-tags) ánd the icon in the presets.
|
|
|
|
*/
|
|
|
|
icon?: string | TagRenderingConfigJson;
|
2020-08-31 02:59:47 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* A string containing "width,height" or "width,height,anchorpoint" where anchorpoint is any of 'center', 'top', 'bottom', 'left', 'right', 'bottomleft','topright', ...
|
|
|
|
* Default is '40,40,center'
|
|
|
|
*/
|
|
|
|
iconSize?: string | TagRenderingConfigJson;
|
|
|
|
|
2020-08-30 01:13:18 +02:00
|
|
|
/**
|
|
|
|
* The color for way-elements
|
|
|
|
*/
|
|
|
|
color?: string | TagRenderingConfigJson;
|
|
|
|
/**
|
|
|
|
* The stroke-width for way-elements
|
|
|
|
*/
|
|
|
|
width?: string | TagRenderingConfigJson;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Wayhandling: should a way/area be displayed as:
|
|
|
|
* 0) The way itself
|
|
|
|
* 1) The centerpoint and the way
|
2020-09-02 11:37:34 +02:00
|
|
|
* 2) Only the centerpoint
|
2020-08-30 01:13:18 +02:00
|
|
|
*/
|
|
|
|
wayHandling?: number;
|
|
|
|
|
2020-09-09 18:42:13 +02:00
|
|
|
/**
|
|
|
|
* Consider that we want to show 'Nature Reserves' and 'Forests'. Now, ofter, there are pieces of forest mapped _in_ the nature reserve.
|
|
|
|
* Now, showing those pieces of forest overlapping with the nature reserve truly clutters the map and is very user-unfriendly.
|
|
|
|
*
|
|
|
|
* The features are placed layer by layer. If a feature below a feature on this layer overlaps for more then 'x'-percent, the underlying feature is hidden.
|
|
|
|
*/
|
|
|
|
hideUnderlayingFeaturesMinPercentage?:number;
|
|
|
|
|
2020-08-30 01:13:18 +02:00
|
|
|
/**
|
|
|
|
* Presets for this layer
|
|
|
|
*/
|
|
|
|
presets?: {
|
|
|
|
title: string | any,
|
2020-08-31 02:59:47 +02:00
|
|
|
tags: string[],
|
2020-08-30 01:13:18 +02:00
|
|
|
description?: string | any,
|
|
|
|
}[],
|
|
|
|
|
|
|
|
/**
|
|
|
|
* All the tag renderings.
|
|
|
|
*/
|
|
|
|
tagRenderings?: (string | TagRenderingConfigJson) []
|
|
|
|
}
|