2020-06-29 03:12:44 +02:00
|
|
|
/**
|
|
|
|
* Asks to add a feature at the last clicked location, at least if zoom is sufficient
|
|
|
|
*/
|
2023-04-06 01:33:08 +02:00
|
|
|
import { UIEventSource } from "../../Logic/UIEventSource"
|
2022-09-08 21:40:48 +02:00
|
|
|
import Translations from "../i18n/Translations"
|
|
|
|
import BaseUIElement from "../BaseUIElement"
|
|
|
|
import { VariableUiElement } from "../Base/VariableUIElement"
|
|
|
|
import Toggle from "../Input/Toggle"
|
|
|
|
import CreateNewNodeAction from "../../Logic/Osm/Actions/CreateNewNodeAction"
|
|
|
|
import { OsmObject, OsmWay } from "../../Logic/Osm/OsmObject"
|
|
|
|
import PresetConfig from "../../Models/ThemeConfig/PresetConfig"
|
|
|
|
import FilteredLayer from "../../Models/FilteredLayer"
|
|
|
|
import Loading from "../Base/Loading"
|
|
|
|
import Hash from "../../Logic/Web/Hash"
|
2022-10-27 01:50:41 +02:00
|
|
|
import { WayId } from "../../Models/OsmFeature"
|
2022-11-08 14:37:48 +01:00
|
|
|
import { Tag } from "../../Logic/Tags/Tag"
|
2023-04-02 02:59:20 +02:00
|
|
|
import { SpecialVisualizationState } from "../SpecialVisualization"
|
|
|
|
import { Feature } from "geojson"
|
2023-04-06 01:33:08 +02:00
|
|
|
import { FixedUiElement } from "../Base/FixedUiElement"
|
2023-04-06 02:20:25 +02:00
|
|
|
import Combine from "../Base/Combine"
|
2021-06-14 02:39:23 +02:00
|
|
|
|
|
|
|
/*
|
2022-09-08 21:40:48 +02:00
|
|
|
* The SimpleAddUI is a single panel, which can have multiple states:
|
|
|
|
* - A list of presets which can be added by the user
|
|
|
|
* - A 'confirm-selection' button (or alternatively: please enable the layer)
|
|
|
|
* - A 'something is wrong - please soom in further'
|
|
|
|
* - A 'read your unread messages before adding a point'
|
2021-06-14 02:39:23 +02:00
|
|
|
*/
|
2021-01-04 04:06:21 +01:00
|
|
|
|
2021-10-31 02:08:39 +01:00
|
|
|
export interface PresetInfo extends PresetConfig {
|
2022-09-08 21:40:48 +02:00
|
|
|
name: string | BaseUIElement
|
|
|
|
icon: () => BaseUIElement
|
|
|
|
layerToAddTo: FilteredLayer
|
2022-01-25 21:55:51 +01:00
|
|
|
boundsFactor?: 0.25 | number
|
2021-06-14 02:39:23 +02:00
|
|
|
}
|
2021-01-08 16:49:42 +01:00
|
|
|
|
2023-04-06 02:20:25 +02:00
|
|
|
export default class SimpleAddUI extends Combine {
|
2023-04-02 02:59:20 +02:00
|
|
|
constructor(state: SpecialVisualizationState) {
|
2023-04-06 02:20:25 +02:00
|
|
|
super([])
|
2020-06-29 03:12:44 +02:00
|
|
|
}
|
2022-09-08 21:40:48 +02:00
|
|
|
}
|