| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  | import { TagRenderingConfigJson } from "./TagRenderingConfigJson" | 
					
						
							|  |  |  | import { TagConfigJson } from "./TagConfigJson" | 
					
						
							| 
									
										
										
										
											2021-10-19 02:31:32 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * The PointRenderingConfig gives all details onto how to render a single point of a feature. | 
					
						
							| 
									
										
										
										
											2021-11-07 16:34:51 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2021-10-19 02:31:32 +02:00
										 |  |  |  * This can be used if: | 
					
						
							| 
									
										
										
										
											2021-11-07 16:34:51 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2021-10-19 02:31:32 +02:00
										 |  |  |  * - The feature is a point | 
					
						
							|  |  |  |  * - To render something at the centroid of an area, or at the start, end or projected centroid of a way | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | export default interface PointRenderingConfigJson { | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * All the locations that this point should be rendered at. | 
					
						
							| 
									
										
										
										
											2023-03-24 19:21:15 +01:00
										 |  |  |      * Possible values are: | 
					
						
							|  |  |  |      * - `point`: only renders points at their location | 
					
						
							|  |  |  |      * - `centroid`: show a symbol at the centerpoint of a (multi)Linestring and (multi)polygon. Points will _not_ be rendered with this | 
					
						
							|  |  |  |      * - `projected_centerpoint`: Only on (multi)linestrings: calculate the centerpoint and snap it to the way | 
					
						
							|  |  |  |      * - `start` and `end`: only on linestrings: add a point to the first/last coordinate of the LineString | 
					
						
							| 
									
										
										
										
											2021-10-19 02:31:32 +02:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2022-04-22 16:09:55 +02:00
										 |  |  |     location: ("point" | "centroid" | "start" | "end" | "projected_centerpoint" | string)[] | 
					
						
							| 
									
										
										
										
											2021-11-07 16:34:51 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-19 02:31:32 +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. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * The result of the icon is rendered as follows: | 
					
						
							|  |  |  |      * the resulting string is interpreted as a _list_ of items, separated by ";". The bottommost layer is the first layer. | 
					
						
							|  |  |  |      * As a result, on could use a generic pin, then overlay it with a specific icon. | 
					
						
							|  |  |  |      * To make things even more practical, one can use all SVG's from the folder "assets/svg" and _substitute the color_ in it. | 
					
						
							|  |  |  |      * E.g. to draw a red pin, use "pin:#f00", to have a green circle with your icon on top, use `circle:#0f0;<path to my icon.svg>` | 
					
						
							| 
									
										
										
										
											2022-01-31 00:39:54 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |      * Type: icon | 
					
						
							| 
									
										
										
										
											2021-10-19 02:31:32 +02:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  |     icon?: string | TagRenderingConfigJson | 
					
						
							| 
									
										
										
										
											2021-10-19 02:31:32 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							| 
									
										
										
										
											2021-10-21 21:41:45 +02:00
										 |  |  |      * A list of extra badges to show next to the icon as small badge | 
					
						
							|  |  |  |      * They will be added as a 25% height icon at the bottom right of the icon, with all the badges in a flex layout. | 
					
						
							| 
									
										
										
										
											2021-10-19 02:31:32 +02:00
										 |  |  |      * | 
					
						
							| 
									
										
										
										
											2021-10-21 21:41:45 +02:00
										 |  |  |      * Note: strings are interpreted as icons, so layering and substituting is supported. You can use `circle:white;./my_icon.svg` to add a background circle | 
					
						
							| 
									
										
										
										
											2021-10-19 02:31:32 +02:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  |     iconBadges?: { | 
					
						
							|  |  |  |         if: TagConfigJson | 
					
						
							| 
									
										
										
										
											2022-01-31 00:39:54 +01:00
										 |  |  |         /** | 
					
						
							|  |  |  |          * Badge to show | 
					
						
							|  |  |  |          * Type: icon | 
					
						
							|  |  |  |          */ | 
					
						
							| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  |         then: string | TagRenderingConfigJson | 
					
						
							| 
									
										
										
										
											2022-01-31 00:39:54 +01:00
										 |  |  |     }[] | 
					
						
							| 
									
										
										
										
											2021-10-19 02:31:32 +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' | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  |     iconSize?: string | TagRenderingConfigJson | 
					
						
							| 
									
										
										
										
											2023-06-20 02:02:45 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * question: What is the anchorpoint of the icon? | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * This matches the geographical point with a location on the icon. | 
					
						
							|  |  |  |      * For example, a feature attached to the ground can use 'bottom' as zooming in will give the appearance of being anchored to a fixed location. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2023-06-20 02:47:20 +02:00
										 |  |  |     anchor?: "center" | "top" | "bottom" | "left" | "right" | string | TagRenderingConfigJson | 
					
						
							| 
									
										
										
										
											2023-06-20 02:02:45 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-19 02:31:32 +02:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * The rotation of an icon, useful for e.g. directions. | 
					
						
							|  |  |  |      * Usage: as if it were a css property for 'rotate', thus has to end with 'deg', e.g. `90deg`, `{direction}deg`, `calc(90deg - {camera:direction}deg)``
 | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  |     rotation?: string | TagRenderingConfigJson | 
					
						
							| 
									
										
										
										
											2021-10-19 02:31:32 +02:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * A HTML-fragment that is shown below the icon, for example: | 
					
						
							| 
									
										
										
										
											2022-06-07 19:48:09 +02:00
										 |  |  |      * <div style="background: white">{name}</div> | 
					
						
							| 
									
										
										
										
											2021-10-19 02:31:32 +02:00
										 |  |  |      * | 
					
						
							|  |  |  |      * If the icon is undefined, then the label is shown in the center of the feature. | 
					
						
							|  |  |  |      * Note that, if the wayhandling hides the icon then no label is shown as well. | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  |     label?: string | TagRenderingConfigJson | 
					
						
							| 
									
										
										
										
											2022-12-09 13:58:41 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							| 
									
										
										
										
											2023-04-02 02:59:20 +02:00
										 |  |  |      * A snippet of css code which is applied onto the container of the entire marker | 
					
						
							| 
									
										
										
										
											2022-12-09 13:58:41 +01:00
										 |  |  |      */ | 
					
						
							|  |  |  |     css?: string | TagRenderingConfigJson | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							| 
									
										
										
										
											2023-04-02 02:59:20 +02:00
										 |  |  |      * A snippet of css-classes which are applied onto the container of the entire marker. They can be space-separated | 
					
						
							| 
									
										
										
										
											2022-12-09 13:58:41 +01:00
										 |  |  |      */ | 
					
						
							|  |  |  |     cssClasses?: string | TagRenderingConfigJson | 
					
						
							| 
									
										
										
										
											2023-03-25 02:48:24 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-02 02:59:20 +02:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * Css that is applied onto the label | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     labelCss?: string | TagRenderingConfigJson | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * Css classes that are applied onto the label; can be space-separated | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     labelCssClasses?: string | TagRenderingConfigJson | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-25 02:48:24 +01:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * If the map is pitched, the marker will stay parallel to the screen. | 
					
						
							|  |  |  |      * Set to 'map' if you want to put it flattened on the map | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     pitchAlignment?: "canvas" | "map" | TagRenderingConfigJson | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * If the map is rotated, the icon will still point to the north if no rotation was applied | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     rotationAlignment?: "map" | "canvas" | TagRenderingConfigJson | 
					
						
							| 
									
										
										
										
											2022-09-08 21:40:48 +02:00
										 |  |  | } |