forked from MapComplete/MapComplete
First working version with multi-rendering
This commit is contained in:
parent
0c0ef48a96
commit
20fa5028d9
5 changed files with 129 additions and 21 deletions
|
@ -29,7 +29,10 @@ export default interface LineRenderingConfigJson {
|
|||
|
||||
/**
|
||||
* The number of pixels this line should be moved.
|
||||
* Use a positive numbe to move to the right, a negative to move to the left (left/right as defined by the drawing direction of the line)
|
||||
* Use a positive numbe to move to the right, a negative to move to the left (left/right as defined by the drawing direction of the line).
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
offset?: number | TagRenderingConfigJson
|
||||
}
|
|
@ -12,12 +12,16 @@ export default class LineRenderingConfig extends WithContextLoader {
|
|||
public readonly width: TagRenderingConfig;
|
||||
public readonly dashArray: TagRenderingConfig;
|
||||
public readonly offset: TagRenderingConfig;
|
||||
|
||||
public readonly leftRightSensitive: boolean
|
||||
|
||||
constructor(json: LineRenderingConfigJson, context: string) {
|
||||
super(json, context)
|
||||
this.color = this.tr("color", "#0000ff");
|
||||
this.width = this.tr("width", "7");
|
||||
this.dashArray = this.tr("dashArray", "");
|
||||
|
||||
this.leftRightSensitive = json.offset !== undefined && json.offset !== 0 && json.offset !== "0"
|
||||
|
||||
this.offset = this.tr("offset", "0");
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ export default class TagRenderingConfig {
|
|||
}
|
||||
|
||||
if(typeof json === "number"){
|
||||
this.render =Translations.WT( ""+json)
|
||||
this.render = Translations.WT( ""+json)
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue