refactoring: fix special renderings (partly), deprecate

This commit is contained in:
Pieter Vander Vennet 2023-03-29 18:54:00 +02:00
parent 9b2f92dedc
commit aaaaf1948d
15 changed files with 160 additions and 95 deletions

View file

@ -363,6 +363,7 @@ ${Utils.special_visualizations_importRequirementDocs}
}
export class ConflateButton extends AbstractImportButton {
needsNodeDatabase = true
constructor() {
super(
"conflate_button",
@ -442,6 +443,8 @@ export class ConflateButton extends AbstractImportButton {
export class ImportWayButton extends AbstractImportButton implements AutoAction {
public readonly supportsAutoAction = true
needsNodeDatabase = true
constructor() {
super(
"import_way_button",

View file

@ -51,13 +51,23 @@ export interface SpecialVisualizationState {
}
export interface SpecialVisualization {
funcName: string
docs: string | BaseUIElement
example?: string
readonly funcName: string
readonly docs: string | BaseUIElement
readonly example?: string
/**
* Indicates that this special visualsiation will make requests to the 'alLNodesDatabase' and that it thus should be included
*/
readonly needsNodeDatabase?: boolean
readonly args: {
name: string
defaultValue?: string
doc: string
required?: false | boolean
}[]
readonly getLayerDependencies?: (argument: string[]) => string[]
structuredExamples?(): { feature: Feature<Geometry, Record<string, string>>; args: string[] }[]
args: { name: string; defaultValue?: string; doc: string; required?: false | boolean }[]
getLayerDependencies?: (argument: string[]) => string[]
constr(
state: SpecialVisualizationState,

View file

@ -55,7 +55,6 @@ import FeatureReviews from "../Logic/Web/MangroveReviews"
import Maproulette from "../Logic/Maproulette"
import SvelteUIElement from "./Base/SvelteUIElement"
import { BBoxFeatureSourceForLayer } from "../Logic/FeatureSource/Sources/TouchesBboxFeatureSource"
import { Feature } from "geojson"
export default class SpecialVisualizations {
public static specialVisualizations: SpecialVisualization[] = SpecialVisualizations.initList()