Fix dasharrays, add custom size PNG export

This commit is contained in:
Pieter Vander Vennet 2024-04-01 01:39:04 +02:00
parent faff07d231
commit a79675c879
7 changed files with 52 additions and 7 deletions

View file

@ -38,7 +38,7 @@ export default interface LineRenderingConfigJson {
/**
* 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
* Cannot be a dynamic property due to a MapLibre limitation (see https://github.com/maplibre/maplibre-gl-js/issues/1235)
* ifunset: Ways are rendered with a full line
*/
dashArray?: string

View file

@ -7,7 +7,7 @@ import { TagsFilter } from "../../Logic/Tags/TagsFilter"
export default class LineRenderingConfig extends WithContextLoader {
public readonly color: TagRenderingConfig
public readonly width: TagRenderingConfig
public readonly dashArray: TagRenderingConfig
public readonly dashArray: string
public readonly lineCap: TagRenderingConfig
public readonly offset: TagRenderingConfig
public readonly fill: TagRenderingConfig
@ -19,7 +19,7 @@ export default class LineRenderingConfig extends WithContextLoader {
super(json, context)
this.color = this.tr("color", "#0000ff")
this.width = this.tr("width", "7")
this.dashArray = this.tr("dashArray", "")
this.dashArray = json.dashArray
this.lineCap = this.tr("lineCap", "round")
this.fill = this.tr("fill", undefined)
this.fillColor = this.tr("fillColor", undefined)