2023-10-06 23:56:50 +02:00
import { MinimalTagRenderingConfigJson } from "./TagRenderingConfigJson"
2024-02-12 12:39:35 +01:00
import { MappingConfigJson } from "./QuestionableTagRenderingConfigJson"
import { TagsFilter } from "../../../Logic/Tags/TagsFilter"
import { TagConfigJson } from "./TagConfigJson"
2021-10-20 02:01:27 +02:00
/ * *
* The LineRenderingConfig gives all details onto how to render a single line of a feature .
2021-11-07 16:34:51 +01:00
*
2021-10-20 02:01:27 +02:00
* This can be used if :
2021-11-07 16:34:51 +01:00
*
2021-10-20 02:01:27 +02:00
* - The feature is a line
* - The feature is an area
* /
export default interface LineRenderingConfigJson {
/ * *
2023-10-06 23:56:50 +02:00
* question : What color should lines be drawn in ?
*
* For an area , this will be the colour of the outside line .
2021-10-20 02:01:27 +02:00
* If the value starts with "--" , the style of the body element will be queried for the corresponding variable instead
2023-10-06 23:56:50 +02:00
*
* types : dynamic value ; string
* title : Line Colour
* inline : The line colour always is < b > { value } < / b >
* type : color
*
2021-10-20 02:01:27 +02:00
* /
2023-10-06 23:56:50 +02:00
color? : MinimalTagRenderingConfigJson | string
2021-10-20 02:01:27 +02:00
/ * *
2023-10-06 23:56:50 +02:00
* question : How wide should the line be ?
2021-10-20 02:01:27 +02:00
* The stroke - width for way - elements
2023-10-06 23:56:50 +02:00
*
* types : dynamic value ; string
* title : Line width
* inline : The line width is < b > { value } pixels < / b >
* type : pnat
* ifunset : Use the default - linewidth of 7 pixels
2021-10-20 02:01:27 +02:00
* /
2023-10-06 23:56:50 +02:00
width? : MinimalTagRenderingConfigJson | number | string
2021-10-20 02:01:27 +02:00
/ * *
2023-10-06 23:56:50 +02:00
* question : Should a dasharray be used to render the lines ?
* The dasharray defines 'pixels of line, pixels of gap, pixels of line, pixels of gap, ...' . For example , ` 5 6 ` will be 5 pixels of line followed by a 6 pixel gap .
* Cannot be a dynamic property due to a mapbox limitation
* ifunset : Ways are rendered with a full line
2021-10-20 02:01:27 +02:00
* /
2023-10-06 23:56:50 +02:00
dashArray? : string
2021-10-22 01:07:32 +02:00
2021-11-08 14:18:45 +01:00
/ * *
2023-10-06 23:56:50 +02:00
* question : What form should the line - ending have ?
* suggestions : return [ { if : "value=round" , then : "Round endings" } , { if : "value=square" , then : "square endings" } , { if : "value=butt" , then : "no ending (square ending at the end, without padding)" } ]
* types : dynamic value ; string
* title : Line Cap
* ifunset : Use the default value ( round ending )
* * /
lineCap ? : "round" | "square" | "butt" | string | MinimalTagRenderingConfigJson
2021-11-08 14:18:45 +01:00
/ * *
2023-10-06 23:56:50 +02:00
* question : What colour should be used as fill colour for polygons ?
* ifunset : The polygon fill colour will be a more transparent version of the stroke colour
* suggestions : return [ { if : "value=#00000000" , then : "Use a transparent fill (only render the outline)" } ]
* inline : The fill colour is < b > { value } < / b >
* types : dynamic value ; string
* type : color
2021-11-08 14:18:45 +01:00
* /
2023-10-06 23:56:50 +02:00
fillColor? : string | MinimalTagRenderingConfigJson
2021-11-08 14:18:45 +01:00
2021-10-22 01:07:32 +02:00
/ * *
2023-10-06 23:56:50 +02:00
* question : Should the lines be moved ( offsetted ) with a number of pixels against the geographical lines ?
2021-11-07 16:34:51 +01:00
* The number of pixels this line should be moved .
2023-10-06 23:56:50 +02:00
* Use a positive number to move to the right in the drawing direction or a negative to move to the left ( left / right as defined by the drawing direction of the line ) .
2021-11-07 16:34:51 +01:00
*
2021-10-22 01:42:44 +02:00
* IMPORTANT : MapComplete will already normalize 'key:both:property' and 'key:both' into the corresponding 'key:left' and 'key:right' tagging ( same for 'sidewalk=left/right/both' which is rewritten to 'sidewalk:left' and 'sidewalk:right' )
* This simplifies programming . Refer to the CalculatedTags . md - documentation for more details
2023-10-06 23:56:50 +02:00
* ifunset : don ' t offset lines on the map
* inline : Pixel offset by < b > { value } < / b > pixels
* types : dynamic value ; number
* type : int
2021-10-22 01:07:32 +02:00
* /
2023-10-06 23:56:50 +02:00
offset? : number | MinimalTagRenderingConfigJson
2024-02-12 12:39:35 +01:00
/ * *
* question : What PNG - image should be shown along the way ?
*
* ifunset : no image is shown along the way
* suggestions : [ { if : "./assets/png/oneway.png" , then : "Show a oneway error" } ]
* type : image
* /
imageAlongWay ? : { if : TagConfigJson , then : string } [ ] | string
2022-03-02 00:07:33 +01:00
}