Formatting
This commit is contained in:
parent
6d822b42ca
commit
61aebc61eb
32 changed files with 664 additions and 511 deletions
|
@ -22,7 +22,7 @@ import Title from "../Base/Title"
|
|||
import { SubstitutedTranslation } from "../SubstitutedTranslation"
|
||||
import FeaturePipelineState from "../../Logic/State/FeaturePipelineState"
|
||||
import TagRenderingQuestion from "./TagRenderingQuestion"
|
||||
import {OsmId} from "../../Models/OsmFeature";
|
||||
import { OsmId } from "../../Models/OsmFeature"
|
||||
|
||||
export default class DeleteWizard extends Toggle {
|
||||
/**
|
||||
|
|
|
@ -248,29 +248,27 @@ export default class FeatureInfoBox extends ScrollableFullScreen {
|
|||
)
|
||||
|
||||
editElements.push(
|
||||
Toggle.If(state.featureSwitchIsDebugging,
|
||||
() => {
|
||||
const config_all_tags: TagRenderingConfig = new TagRenderingConfig(
|
||||
{ render: "{all_tags()}" },
|
||||
""
|
||||
)
|
||||
const config_download: TagRenderingConfig = new TagRenderingConfig(
|
||||
{ render: "{export_as_geojson()}" },
|
||||
""
|
||||
)
|
||||
const config_id: TagRenderingConfig = new TagRenderingConfig(
|
||||
{ render: "{open_in_iD()}" },
|
||||
""
|
||||
)
|
||||
|
||||
return new Combine([
|
||||
new TagRenderingAnswer(tags, config_all_tags, state),
|
||||
new TagRenderingAnswer(tags, config_download, state),
|
||||
new TagRenderingAnswer(tags, config_id, state),
|
||||
"This is layer " + layerConfig.id,
|
||||
])
|
||||
}
|
||||
Toggle.If(state.featureSwitchIsDebugging, () => {
|
||||
const config_all_tags: TagRenderingConfig = new TagRenderingConfig(
|
||||
{ render: "{all_tags()}" },
|
||||
""
|
||||
)
|
||||
const config_download: TagRenderingConfig = new TagRenderingConfig(
|
||||
{ render: "{export_as_geojson()}" },
|
||||
""
|
||||
)
|
||||
const config_id: TagRenderingConfig = new TagRenderingConfig(
|
||||
{ render: "{open_in_iD()}" },
|
||||
""
|
||||
)
|
||||
|
||||
return new Combine([
|
||||
new TagRenderingAnswer(tags, config_all_tags, state),
|
||||
new TagRenderingAnswer(tags, config_download, state),
|
||||
new TagRenderingAnswer(tags, config_id, state),
|
||||
"This is layer " + layerConfig.id,
|
||||
])
|
||||
})
|
||||
)
|
||||
|
||||
return new Combine(editElements).SetClass("flex flex-col")
|
||||
|
|
|
@ -145,7 +145,7 @@ export default class MoveWizard extends Toggle {
|
|||
minZoom: reason.minZoom,
|
||||
centerLocation: loc,
|
||||
mapBackground: new UIEventSource<BaseLayer>(preferredBackground), // We detach the layer
|
||||
state: <any> state
|
||||
state: <any>state,
|
||||
})
|
||||
|
||||
if (reason.lockBounds) {
|
||||
|
|
|
@ -51,18 +51,18 @@ export default class TagApplyButton implements AutoAction {
|
|||
* // Should handle escaped ";"
|
||||
* TagApplyButton.parseTagSpec("key=value;key0=value0\\;value1") // => [["key","value"],["key0","value0;value1"]]
|
||||
*/
|
||||
private static parseTagSpec(spec: string): [string, string][]{
|
||||
const tgsSpec : [string, string][] = []
|
||||
private static parseTagSpec(spec: string): [string, string][] {
|
||||
const tgsSpec: [string, string][] = []
|
||||
|
||||
while(spec.length > 0){
|
||||
while (spec.length > 0) {
|
||||
const [part] = spec.match(/((\\;)|[^;])*/)
|
||||
spec = spec.substring(part.length + 1) // +1 to remove the pending ';' as well
|
||||
const kv = part.split("=").map((s) => s.trim().replace("\\;",";"))
|
||||
const kv = part.split("=").map((s) => s.trim().replace("\\;", ";"))
|
||||
if (kv.length == 2) {
|
||||
tgsSpec.push(<[string, string]> kv)
|
||||
}else if (kv.length < 2) {
|
||||
tgsSpec.push(<[string, string]>kv)
|
||||
} else if (kv.length < 2) {
|
||||
throw "Invalid key spec: no '=' found in " + spec
|
||||
}else{
|
||||
} else {
|
||||
throw "Invalid key spec: multiple '=' found in " + spec
|
||||
}
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ export default class TagApplyButton implements AutoAction {
|
|||
spec = tagSource.data[spec.replace("$", "")]
|
||||
}
|
||||
|
||||
const tgsSpec = TagApplyButton.parseTagSpec(spec)
|
||||
const tgsSpec = TagApplyButton.parseTagSpec(spec)
|
||||
|
||||
return tagSource.map((tags) => {
|
||||
const newTags: Tag[] = []
|
||||
|
|
|
@ -304,7 +304,7 @@ export default class TagRenderingQuestion extends Combine {
|
|||
const patchedMapping = <Mapping>{
|
||||
...mapping,
|
||||
iconClass: mapping.iconClass ?? `small-height`,
|
||||
icon: mapping.icon ?? (addIcons ? "./assets/svg/none.svg" : undefined)
|
||||
icon: mapping.icon ?? (addIcons ? "./assets/svg/none.svg" : undefined),
|
||||
}
|
||||
const fancy = TagRenderingQuestion.GenerateMappingContent(
|
||||
patchedMapping,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue