forked from MapComplete/MapComplete
Merge develop
This commit is contained in:
commit
7c5170da15
193 changed files with 4011 additions and 4462 deletions
|
|
@ -156,7 +156,7 @@ export class On<P, T> extends DesugaringStep<T> {
|
|||
|
||||
convert(json: T, context: ConversionContext): T {
|
||||
const key = this.key
|
||||
const value: P = json[key]
|
||||
const value: P = json?.[key]
|
||||
if (value === undefined || value === null) {
|
||||
return json
|
||||
}
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@ class AddDependencyLayersToTheme extends DesugaringStep<LayoutConfigJson> {
|
|||
themeId: string
|
||||
): { config: LayerConfigJson; reason: string }[] {
|
||||
const dependenciesToAdd: { config: LayerConfigJson; reason: string }[] = []
|
||||
const loadedLayerIds: Set<string> = new Set<string>(alreadyLoaded.map((l) => l.id))
|
||||
const loadedLayerIds: Set<string> = new Set<string>(alreadyLoaded.map((l) => l?.id))
|
||||
|
||||
// Verify cross-dependencies
|
||||
let unmetDependencies: {
|
||||
|
|
|
|||
|
|
@ -82,5 +82,5 @@ export default interface LineRenderingConfigJson {
|
|||
* suggestions: [{if: "./assets/png/oneway.png", then: "Show a oneway error"}]
|
||||
* type: image
|
||||
*/
|
||||
imageAlongWay?: {if: TagConfigJson, then: string}[] | string
|
||||
imageAlongWay?: { if: TagConfigJson; then: string }[] | string
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,15 @@ export default interface PointRenderingConfigJson {
|
|||
* multianswer: true
|
||||
* suggestions: return [{if: "value=point",then: "Show an icon for point (node) objects"},{if: "value=centroid",then: "Show an icon for line or polygon (way) objects at their centroid location"}, {if: "value=start",then: "Show an icon for line (way) objects at the start"},{if: "value=end",then: "Show an icon for line (way) object at the end"},{if: "value=projected_centerpoint",then: "Show an icon for line (way) object near the centroid location, but moved onto the line. Does not show an item on polygons"}, ,{if: "value=polygon_centroid",then: "Show an icon at a polygon centroid (but not if it is a way)"}]
|
||||
*/
|
||||
location: ("point" | "centroid" | "start" | "end" | "projected_centerpoint" | "polygon_centroid" | string)[]
|
||||
location: (
|
||||
| "point"
|
||||
| "centroid"
|
||||
| "start"
|
||||
| "end"
|
||||
| "projected_centerpoint"
|
||||
| "polygon_centroid"
|
||||
| string
|
||||
)[]
|
||||
|
||||
/**
|
||||
* The marker for an element.
|
||||
|
|
|
|||
|
|
@ -28,8 +28,6 @@ import { ImmutableStore } from "../../Logic/UIEventSource"
|
|||
import { OsmTags } from "../OsmFeature"
|
||||
import Constants from "../Constants"
|
||||
import { QuestionableTagRenderingConfigJson } from "./Json/QuestionableTagRenderingConfigJson"
|
||||
import SvelteUIElement from "../../UI/Base/SvelteUIElement"
|
||||
import Statistics from "../../assets/svg/Statistics.svelte"
|
||||
|
||||
export default class LayerConfig extends WithContextLoader {
|
||||
public static readonly syncSelectionAllowed = ["no", "local", "theme-only", "global"] as const
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ export default class LineRenderingConfig extends WithContextLoader {
|
|||
public readonly fill: TagRenderingConfig
|
||||
public readonly fillColor: TagRenderingConfig
|
||||
public readonly leftRightSensitive: boolean
|
||||
public readonly imageAlongWay: { if?: TagsFilter, then: string }[]
|
||||
public readonly imageAlongWay: { if?: TagsFilter; then: string }[]
|
||||
|
||||
constructor(json: LineRenderingConfigJson, context: string) {
|
||||
super(json, context)
|
||||
|
|
@ -33,15 +33,13 @@ export default class LineRenderingConfig extends WithContextLoader {
|
|||
for (let i = 0; i < json.imageAlongWay.length; i++) {
|
||||
const imgAlong = json.imageAlongWay[i]
|
||||
const ctx = context + ".imageAlongWay[" + i + "]"
|
||||
if(!imgAlong.then.endsWith(".png")){
|
||||
if (!imgAlong.then.endsWith(".png")) {
|
||||
throw "An imageAlongWay should always be a PNG image"
|
||||
}
|
||||
this.imageAlongWay.push(
|
||||
{
|
||||
if: TagUtils.Tag(imgAlong.if, ctx),
|
||||
then: imgAlong.then,
|
||||
},
|
||||
)
|
||||
this.imageAlongWay.push({
|
||||
if: TagUtils.Tag(imgAlong.if, ctx),
|
||||
then: imgAlong.then,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,10 +38,16 @@ export default class PointRenderingConfig extends WithContextLoader {
|
|||
"start",
|
||||
"end",
|
||||
"projected_centerpoint",
|
||||
"polygon_centroid"
|
||||
"polygon_centroid",
|
||||
])
|
||||
public readonly location: Set<
|
||||
"point" | "centroid" | "start" | "end" | "projected_centerpoint" | "polygon_centroid" | string
|
||||
| "point"
|
||||
| "centroid"
|
||||
| "start"
|
||||
| "end"
|
||||
| "projected_centerpoint"
|
||||
| "polygon_centroid"
|
||||
| string
|
||||
>
|
||||
|
||||
public readonly marker: IconConfig[]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue