forked from MapComplete/MapComplete
UK-themes: add inspire polygons to detect addresses with, various small fixes
This commit is contained in:
parent
be3ac93eca
commit
2c46645581
7 changed files with 71 additions and 23 deletions
|
@ -192,11 +192,11 @@ export default class LayerConfig extends WithContextLoader {
|
|||
}
|
||||
|
||||
this.mapRendering = json.mapRendering
|
||||
.filter(r => r["icon"] !== undefined || r["label"] !== undefined)
|
||||
.filter(r => r["location"] !== undefined)
|
||||
.map((r, i) => new PointRenderingConfig(<PointRenderingConfigJson>r, context + ".mapRendering[" + i + "]"))
|
||||
|
||||
this.lineRendering = json.mapRendering
|
||||
.filter(r => r["icon"] === undefined && r["label"] === undefined)
|
||||
.filter(r => r["location"] === undefined)
|
||||
.map((r, i) => new LineRenderingConfig(<LineRenderingConfigJson>r, context + ".mapRendering[" + i + "]"))
|
||||
|
||||
|
||||
|
|
|
@ -39,6 +39,10 @@ export default class PointRenderingConfig extends WithContextLoader {
|
|||
throw `A point rendering has an invalid location: '${l}' is not one of ${Array.from(allowed).join(", ")} (at ${context}.location)`
|
||||
}
|
||||
})
|
||||
|
||||
if(json.icon === undefined && json.label === undefined){
|
||||
throw `A point rendering should define at least an icon or a label`
|
||||
}
|
||||
|
||||
if(this.location.size == 0){
|
||||
throw "A pointRendering should have at least one 'location' to defined where it should be rendered. (At "+context+".location)"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue