Studio: some more tweaks
This commit is contained in:
parent
69a7c9efa3
commit
d749b5c68f
8 changed files with 577 additions and 19 deletions
|
@ -186,7 +186,7 @@ export class ValidateTheme extends DesugaringStep<LayoutConfigJson> {
|
|||
for (const remoteImage of remoteImages) {
|
||||
context.err(
|
||||
"Found a remote image: " +
|
||||
remoteImage +
|
||||
remoteImage.path +
|
||||
" in theme " +
|
||||
json.id +
|
||||
", please download it."
|
||||
|
@ -899,9 +899,6 @@ export class ValidateLayer extends Conversion<
|
|||
)
|
||||
}
|
||||
|
||||
if (context.hasErrors()) {
|
||||
return undefined
|
||||
}
|
||||
let layerConfig: LayerConfig
|
||||
try {
|
||||
layerConfig = new LayerConfig(json, "validation", true)
|
||||
|
@ -1105,11 +1102,21 @@ export class ValidateLayer extends Conversion<
|
|||
).convert(json, context)
|
||||
}
|
||||
|
||||
{
|
||||
json.pointRendering?.forEach((pointRendering, index) => {
|
||||
pointRendering?.marker?.forEach((icon, indexM) => {
|
||||
if (json.pointRendering !== null) {
|
||||
if (!Array.isArray(json.pointRendering)) {
|
||||
throw (
|
||||
"pointRendering in " +
|
||||
json.id +
|
||||
" is not iterable, it is: " +
|
||||
typeof json.pointRendering
|
||||
)
|
||||
}
|
||||
for (const pointRendering of json.pointRendering) {
|
||||
const index = json.pointRendering.indexOf(pointRendering)
|
||||
for (const icon of pointRendering?.marker) {
|
||||
const indexM = pointRendering?.marker.indexOf(icon)
|
||||
if (!icon.icon) {
|
||||
return
|
||||
continue
|
||||
}
|
||||
if (icon.icon["condition"]) {
|
||||
context
|
||||
|
@ -1125,8 +1132,8 @@ export class ValidateLayer extends Conversion<
|
|||
"Don't set a condition in a marker as this will result in an invisible but clickable element. Use extra filters in the source instead."
|
||||
)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (json.presets !== undefined) {
|
||||
|
|
|
@ -201,7 +201,7 @@ export interface LayoutConfigJson {
|
|||
* type: layer[]
|
||||
* types: hidden | layer | hidden
|
||||
* group: layers
|
||||
*
|
||||
* suggestions: return Array.from(layers.keys()).map(key => ({if: "value="+key, then: key+" - "+layers.get(key).description}))
|
||||
* Every layer contains a description of which feature to display - the overpassTags which are queried.
|
||||
* Instead of running one query for every layer, the query is fused.
|
||||
*
|
||||
|
|
|
@ -85,7 +85,6 @@ export default class LayoutConfig implements LayoutInformation {
|
|||
definitionRaw?: string
|
||||
}
|
||||
) {
|
||||
console.log("Initing theme", { json, official, options })
|
||||
if (json === undefined) {
|
||||
throw "Cannot construct a layout config, the parameter 'json' is undefined"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue