Chore: fix warnings
This commit is contained in:
parent
ab70c6adc0
commit
47ae4cb456
38 changed files with 49 additions and 90 deletions
|
@ -1,10 +1,6 @@
|
||||||
import { Store, UIEventSource } from "../UIEventSource"
|
import {Store, UIEventSource} from "../UIEventSource"
|
||||||
import { Utils } from "../../Utils"
|
import {Utils} from "../../Utils"
|
||||||
import {
|
import {RasterLayerPolygon, RasterLayerUtils,} from "../../Models/RasterLayers"
|
||||||
AvailableRasterLayers,
|
|
||||||
RasterLayerPolygon,
|
|
||||||
RasterLayerUtils,
|
|
||||||
} from "../../Models/RasterLayers"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When a user pans around on the map, they might pan out of the range of the current background raster layer.
|
* When a user pans around on the map, they might pan out of the range of the current background raster layer.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { FeatureSource, IndexedFeatureSource } from "../FeatureSource"
|
import {FeatureSource} from "../FeatureSource"
|
||||||
import { UIEventSource } from "../../UIEventSource"
|
import {UIEventSource} from "../../UIEventSource"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a UIEventStore for the properties of every Feature, indexed by id
|
* Constructs a UIEventStore for the properties of every Feature, indexed by id
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import { Store, UIEventSource } from "../UIEventSource"
|
import { Store, UIEventSource } from "../UIEventSource"
|
||||||
import FilteredLayer from "../../Models/FilteredLayer"
|
import FilteredLayer from "../../Models/FilteredLayer"
|
||||||
import { BBox } from "../BBox"
|
|
||||||
import { Feature } from "geojson"
|
import { Feature } from "geojson"
|
||||||
|
|
||||||
export interface FeatureSource<T extends Feature = Feature> {
|
export interface FeatureSource<T extends Feature = Feature> {
|
||||||
|
|
|
@ -12,8 +12,8 @@ export class WikidataImageProvider extends ImageProvider {
|
||||||
super()
|
super()
|
||||||
}
|
}
|
||||||
|
|
||||||
public SourceIcon(backlinkSource?: string): BaseUIElement {
|
public SourceIcon(_?: string): BaseUIElement {
|
||||||
throw Svg.wikidata_svg()
|
return Svg.wikidata_svg()
|
||||||
}
|
}
|
||||||
|
|
||||||
public async ExtractUrls(key: string, value: string): Promise<Promise<ProvidedImage>[]> {
|
public async ExtractUrls(key: string, value: string): Promise<Promise<ProvidedImage>[]> {
|
||||||
|
@ -48,7 +48,7 @@ export class WikidataImageProvider extends ImageProvider {
|
||||||
return allImages
|
return allImages
|
||||||
}
|
}
|
||||||
|
|
||||||
public DownloadAttribution(url: string): Promise<any> {
|
public DownloadAttribution(_: string): Promise<any> {
|
||||||
throw new Error("Method not implemented; shouldn't be needed!")
|
throw new Error("Method not implemented; shouldn't be needed!")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,6 @@ export class WikimediaImageProvider extends ImageProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
public PrepUrl(value: string): ProvidedImage {
|
public PrepUrl(value: string): ProvidedImage {
|
||||||
const hasCommonsPrefix = WikimediaImageProvider.startsWithCommonsPrefix(value)
|
|
||||||
value = WikimediaImageProvider.removeCommonsPrefix(value)
|
value = WikimediaImageProvider.removeCommonsPrefix(value)
|
||||||
|
|
||||||
if (value.startsWith("File:")) {
|
if (value.startsWith("File:")) {
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import { ChangeDescription } from "./ChangeDescription"
|
import { ChangeDescription } from "./ChangeDescription"
|
||||||
import OsmChangeAction from "./OsmChangeAction"
|
import OsmChangeAction from "./OsmChangeAction"
|
||||||
import { Changes } from "../Changes"
|
|
||||||
|
|
||||||
export default class ChangeLocationAction extends OsmChangeAction {
|
export default class ChangeLocationAction extends OsmChangeAction {
|
||||||
private readonly _id: number
|
private readonly _id: number
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import OsmChangeAction from "./OsmChangeAction"
|
import OsmChangeAction from "./OsmChangeAction"
|
||||||
import { Changes } from "../Changes"
|
|
||||||
import { ChangeDescription } from "./ChangeDescription"
|
import { ChangeDescription } from "./ChangeDescription"
|
||||||
import { TagsFilter } from "../../Tags/TagsFilter"
|
import { TagsFilter } from "../../Tags/TagsFilter"
|
||||||
import { OsmTags } from "../../../Models/OsmFeature"
|
import { OsmTags } from "../../../Models/OsmFeature"
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { ChangeDescription } from "./ChangeDescription"
|
import {ChangeDescription} from "./ChangeDescription"
|
||||||
import {OsmCreateAction, PreviewableAction} from "./OsmChangeAction"
|
import {OsmCreateAction} from "./OsmChangeAction"
|
||||||
import { Changes } from "../Changes"
|
import {Changes} from "../Changes"
|
||||||
import { Tag } from "../../Tags/Tag"
|
import {Tag} from "../../Tags/Tag"
|
||||||
import CreateNewNodeAction from "./CreateNewNodeAction"
|
import CreateNewNodeAction from "./CreateNewNodeAction"
|
||||||
import { And } from "../../Tags/And"
|
import {And} from "../../Tags/And"
|
||||||
|
|
||||||
export default class CreateNewWayAction extends OsmCreateAction {
|
export default class CreateNewWayAction extends OsmCreateAction {
|
||||||
public newElementId: string = undefined
|
public newElementId: string = undefined
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { OsmObject, OsmWay } from "../OsmObject"
|
import {OsmWay} from "../OsmObject"
|
||||||
import { Changes } from "../Changes"
|
import {Changes} from "../Changes"
|
||||||
import { GeoOperations } from "../../GeoOperations"
|
import {GeoOperations} from "../../GeoOperations"
|
||||||
import OsmChangeAction from "./OsmChangeAction"
|
import OsmChangeAction from "./OsmChangeAction"
|
||||||
import { ChangeDescription } from "./ChangeDescription"
|
import {ChangeDescription} from "./ChangeDescription"
|
||||||
import RelationSplitHandler from "./RelationSplitHandler"
|
import RelationSplitHandler from "./RelationSplitHandler"
|
||||||
import { Feature, LineString } from "geojson"
|
import {Feature, LineString} from "geojson"
|
||||||
import OsmObjectDownloader from "../OsmObjectDownloader"
|
import OsmObjectDownloader from "../OsmObjectDownloader"
|
||||||
|
|
||||||
interface SplitInfo {
|
interface SplitInfo {
|
||||||
|
|
|
@ -2,7 +2,6 @@ import osmAuth from "osm-auth"
|
||||||
import { Store, Stores, UIEventSource } from "../UIEventSource"
|
import { Store, Stores, UIEventSource } from "../UIEventSource"
|
||||||
import { OsmPreferences } from "./OsmPreferences"
|
import { OsmPreferences } from "./OsmPreferences"
|
||||||
import { Utils } from "../../Utils"
|
import { Utils } from "../../Utils"
|
||||||
import { OsmObject } from "./OsmObject"
|
|
||||||
|
|
||||||
export default class UserDetails {
|
export default class UserDetails {
|
||||||
public loggedIn = false
|
public loggedIn = false
|
||||||
|
|
|
@ -10,7 +10,6 @@ import { CountryCoder } from "latlon2country"
|
||||||
import Constants from "../Models/Constants"
|
import Constants from "../Models/Constants"
|
||||||
import { TagUtils } from "./Tags/TagUtils"
|
import { TagUtils } from "./Tags/TagUtils"
|
||||||
import { Feature, LineString } from "geojson"
|
import { Feature, LineString } from "geojson"
|
||||||
import { OsmObject } from "./Osm/OsmObject"
|
|
||||||
import { OsmTags } from "../Models/OsmFeature"
|
import { OsmTags } from "../Models/OsmFeature"
|
||||||
import { UIEventSource } from "./UIEventSource"
|
import { UIEventSource } from "./UIEventSource"
|
||||||
import LayoutConfig from "../Models/ThemeConfig/LayoutConfig"
|
import LayoutConfig from "../Models/ThemeConfig/LayoutConfig"
|
||||||
|
|
|
@ -264,10 +264,8 @@ export abstract class Store<T> implements Readable<T> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Same as 'addCallbackAndRun', added to be compatible with Svelte
|
* Same as 'addCallbackAndRun', added to be compatible with Svelte
|
||||||
* @param run
|
|
||||||
* @param invalidate
|
|
||||||
*/
|
*/
|
||||||
public subscribe(run: Subscriber<T> & ((value: T) => void), invalidate?): Unsubscriber {
|
public subscribe(run: Subscriber<T> & ((value: T) => void), _?): Unsubscriber {
|
||||||
// We don't need to do anything with 'invalidate', see
|
// We don't need to do anything with 'invalidate', see
|
||||||
// https://github.com/sveltejs/svelte/issues/3859
|
// https://github.com/sveltejs/svelte/issues/3859
|
||||||
|
|
||||||
|
@ -288,7 +286,7 @@ export class ImmutableStore<T> extends Store<T> {
|
||||||
this.data = data
|
this.data = data
|
||||||
}
|
}
|
||||||
|
|
||||||
addCallback(callback: (data: T) => void): () => void {
|
addCallback(_: (data: T) => void): () => void {
|
||||||
// pass: data will never change
|
// pass: data will never change
|
||||||
return ImmutableStore.pass
|
return ImmutableStore.pass
|
||||||
}
|
}
|
||||||
|
@ -307,7 +305,7 @@ export class ImmutableStore<T> extends Store<T> {
|
||||||
return ImmutableStore.pass
|
return ImmutableStore.pass
|
||||||
}
|
}
|
||||||
|
|
||||||
addCallbackD(callback: (data: T) => void): () => void {
|
addCallbackD(_: (data: T) => void): () => void {
|
||||||
// pass: data will never change
|
// pass: data will never change
|
||||||
return ImmutableStore.pass
|
return ImmutableStore.pass
|
||||||
}
|
}
|
||||||
|
|
|
@ -302,7 +302,7 @@ class OverrideShadowingCheck extends DesugaringStep<LayoutConfigJson> {
|
||||||
|
|
||||||
convert(
|
convert(
|
||||||
json: LayoutConfigJson,
|
json: LayoutConfigJson,
|
||||||
context: string
|
_: string
|
||||||
): { result: LayoutConfigJson; errors?: string[]; warnings?: string[] } {
|
): { result: LayoutConfigJson; errors?: string[]; warnings?: string[] } {
|
||||||
const overrideAll = json.overrideAll
|
const overrideAll = json.overrideAll
|
||||||
if (overrideAll === undefined) {
|
if (overrideAll === undefined) {
|
||||||
|
@ -973,7 +973,7 @@ export class DetectDuplicateFilters extends DesugaringStep<{
|
||||||
|
|
||||||
convert(
|
convert(
|
||||||
json: { layers: LayerConfigJson[]; themes: LayoutConfigJson[] },
|
json: { layers: LayerConfigJson[]; themes: LayoutConfigJson[] },
|
||||||
context: string
|
__: string
|
||||||
): {
|
): {
|
||||||
result: { layers: LayerConfigJson[]; themes: LayoutConfigJson[] }
|
result: { layers: LayerConfigJson[]; themes: LayoutConfigJson[] }
|
||||||
errors?: string[]
|
errors?: string[]
|
||||||
|
|
|
@ -3,11 +3,9 @@ import { TagsFilter } from "../../Logic/Tags/TagsFilter"
|
||||||
import { DeleteConfigJson } from "./Json/DeleteConfigJson"
|
import { DeleteConfigJson } from "./Json/DeleteConfigJson"
|
||||||
import Translations from "../../UI/i18n/Translations"
|
import Translations from "../../UI/i18n/Translations"
|
||||||
import { TagUtils } from "../../Logic/Tags/TagUtils"
|
import { TagUtils } from "../../Logic/Tags/TagUtils"
|
||||||
import TagRenderingEditable from "../../UI/Popup/TagRendering/TagRenderingEditable.svelte";
|
|
||||||
import TagRenderingConfig from "./TagRenderingConfig";
|
import TagRenderingConfig from "./TagRenderingConfig";
|
||||||
import {QuestionableTagRenderingConfigJson} from "./Json/QuestionableTagRenderingConfigJson";
|
import {QuestionableTagRenderingConfigJson} from "./Json/QuestionableTagRenderingConfigJson";
|
||||||
import {TagConfigJson} from "./Json/TagConfigJson";
|
import {TagConfigJson} from "./Json/TagConfigJson";
|
||||||
import {del} from "idb-keyval";
|
|
||||||
|
|
||||||
export default class DeleteConfig {
|
export default class DeleteConfig {
|
||||||
public static readonly deleteReasonKey = "_delete_reason"
|
public static readonly deleteReasonKey = "_delete_reason"
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
* This overlay element will regularly show a hand that swipes over the underlying element.
|
* This overlay element will regularly show a hand that swipes over the underlying element.
|
||||||
* This element will hide as soon as the Store 'hideSignal' receives a change (which is not undefined)
|
* This element will hide as soon as the Store 'hideSignal' receives a change (which is not undefined)
|
||||||
*/
|
*/
|
||||||
import ToSvelte from "./ToSvelte.svelte";
|
|
||||||
import Svg from "../../Svg";
|
|
||||||
import { Store } from "../../Logic/UIEventSource";
|
import { Store } from "../../Logic/UIEventSource";
|
||||||
import { onDestroy } from "svelte";
|
import { onDestroy } from "svelte";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Loading from "./Loading.svelte";
|
import Loading from "./Loading.svelte";
|
||||||
import type { SpecialVisualizationState } from "../SpecialVisualization";
|
|
||||||
import type { OsmServiceState } from "../../Logic/Osm/OsmConnection";
|
import type { OsmServiceState } from "../../Logic/Osm/OsmConnection";
|
||||||
import { Translation } from "../i18n/Translation";
|
import { Translation } from "../i18n/Translation";
|
||||||
import Translations from "../i18n/Translations";
|
import Translations from "../i18n/Translations";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {createEventDispatcher, onMount} from "svelte";
|
import {onMount} from "svelte";
|
||||||
import BaseUIElement from "../BaseUIElement";
|
import BaseUIElement from "../BaseUIElement";
|
||||||
import Img from "./Img";
|
import Img from "./Img";
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,7 @@
|
||||||
import {Store, UIEventSource} from "../../Logic/UIEventSource";
|
import {Store, UIEventSource} from "../../Logic/UIEventSource";
|
||||||
import type {RasterLayerPolygon} from "../../Models/RasterLayers";
|
import type {RasterLayerPolygon} from "../../Models/RasterLayers";
|
||||||
import {AvailableRasterLayers} from "../../Models/RasterLayers";
|
import {AvailableRasterLayers} from "../../Models/RasterLayers";
|
||||||
import Tr from "../Base/Tr.svelte";
|
|
||||||
import {createEventDispatcher, onDestroy} from "svelte";
|
import {createEventDispatcher, onDestroy} from "svelte";
|
||||||
import Translations from "../i18n/Translations";
|
|
||||||
import Svg from "../../Svg";
|
import Svg from "../../Svg";
|
||||||
import {Map as MlMap} from "maplibre-gl"
|
import {Map as MlMap} from "maplibre-gl"
|
||||||
import type {MapProperties} from "../../Models/MapProperties";
|
import type {MapProperties} from "../../Models/MapProperties";
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {UIEventSource} from "../../Logic/UIEventSource"
|
import {UIEventSource} from "../../Logic/UIEventSource"
|
||||||
import Svg from "../../Svg"
|
import Svg from "../../Svg"
|
||||||
import SubtleButton from "../Base/SubtleButton.svelte"
|
|
||||||
import ToSvelte from "../Base/ToSvelte.svelte"
|
import ToSvelte from "../Base/ToSvelte.svelte"
|
||||||
import Translations from "../i18n/Translations"
|
import Translations from "../i18n/Translations"
|
||||||
import Tr from "../Base/Tr.svelte";
|
import Tr from "../Base/Tr.svelte";
|
||||||
|
|
|
@ -127,7 +127,7 @@ export class StackedRenderingChart extends ChartJs {
|
||||||
let earliest: Date = undefined
|
let earliest: Date = undefined
|
||||||
let latest: Date = undefined
|
let latest: Date = undefined
|
||||||
let allDates = new Set<string>()
|
let allDates = new Set<string>()
|
||||||
features.forEach((value, key) => {
|
features.forEach((value) => {
|
||||||
const d = new Date(value.properties.date)
|
const d = new Date(value.properties.date)
|
||||||
Utils.SetMidnight(d)
|
Utils.SetMidnight(d)
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ export abstract class Validator {
|
||||||
*
|
*
|
||||||
* Returns 'undefined' if the element is valid
|
* Returns 'undefined' if the element is valid
|
||||||
*/
|
*/
|
||||||
public getFeedback(s: string, requestCountry?: () => string): Translation | undefined {
|
public getFeedback(s: string, _?: () => string): Translation | undefined {
|
||||||
if(this.isValid(s)){
|
if(this.isValid(s)){
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
@ -61,16 +61,14 @@ export abstract class Validator {
|
||||||
return Translations.t.validation[this.name].description
|
return Translations.t.validation[this.name].description
|
||||||
}
|
}
|
||||||
|
|
||||||
public isValid(string: string, requestCountry?: () => string): boolean {
|
public isValid(_: string, __?: () => string): boolean {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reformats for the human
|
* Reformats for the human
|
||||||
* @param s
|
|
||||||
* @param country
|
|
||||||
*/
|
*/
|
||||||
public reformat(s: string, country?: () => string): string {
|
public reformat(s: string, _?: () => string): string {
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
import Combine from "../../Base/Combine"
|
import Combine from "../../Base/Combine"
|
||||||
import Wikidata from "../../../Logic/Web/Wikidata"
|
import Wikidata from "../../../Logic/Web/Wikidata"
|
||||||
import { UIEventSource } from "../../../Logic/UIEventSource"
|
|
||||||
import Locale from "../../i18n/Locale"
|
|
||||||
import { Utils } from "../../../Utils"
|
|
||||||
import WikidataSearchBox from "../../Wikipedia/WikidataSearchBox"
|
import WikidataSearchBox from "../../Wikipedia/WikidataSearchBox"
|
||||||
import { Validator } from "../Validator"
|
import { Validator } from "../Validator"
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
import type PresetConfig from "../../../Models/ThemeConfig/PresetConfig";
|
import type PresetConfig from "../../../Models/ThemeConfig/PresetConfig";
|
||||||
import Tr from "../../Base/Tr.svelte";
|
import Tr from "../../Base/Tr.svelte";
|
||||||
import Translations from "../../i18n/Translations.js";
|
import Translations from "../../i18n/Translations.js";
|
||||||
import SubtleButton from "../../Base/SubtleButton.svelte";
|
|
||||||
import {Translation} from "../../i18n/Translation";
|
import {Translation} from "../../i18n/Translation";
|
||||||
import type {SpecialVisualizationState} from "../../SpecialVisualization";
|
import type {SpecialVisualizationState} from "../../SpecialVisualization";
|
||||||
import {ImmutableStore} from "../../../Logic/UIEventSource";
|
import {ImmutableStore} from "../../../Logic/UIEventSource";
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import ToSvelte from "../Base/ToSvelte.svelte";
|
import ToSvelte from "../Base/ToSvelte.svelte";
|
||||||
import Table from "../Base/Table";
|
import Table from "../Base/Table";
|
||||||
import { UIEventSource } from "../../Logic/UIEventSource";
|
import {UIEventSource} from "../../Logic/UIEventSource";
|
||||||
import SimpleMetaTaggers from "../../Logic/SimpleMetaTagger";
|
import SimpleMetaTaggers from "../../Logic/SimpleMetaTagger";
|
||||||
import { FixedUiElement } from "../Base/FixedUiElement";
|
import {FixedUiElement} from "../Base/FixedUiElement";
|
||||||
import { onDestroy } from "svelte";
|
import {onDestroy} from "svelte";
|
||||||
import Toggle, { ClickableToggle } from "../Input/Toggle";
|
import Toggle from "../Input/Toggle";
|
||||||
import Lazy from "../Base/Lazy";
|
import Lazy from "../Base/Lazy";
|
||||||
import BaseUIElement from "../BaseUIElement";
|
import BaseUIElement from "../BaseUIElement";
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
import Translations from "../i18n/Translations"
|
import Translations from "../i18n/Translations"
|
||||||
import { SubtleButton } from "../Base/SubtleButton"
|
import {SubtleButton} from "../Base/SubtleButton"
|
||||||
import Svg from "../../Svg"
|
import Svg from "../../Svg"
|
||||||
import Combine from "../Base/Combine"
|
import Combine from "../Base/Combine"
|
||||||
import { GeoOperations } from "../../Logic/GeoOperations"
|
import {GeoOperations} from "../../Logic/GeoOperations"
|
||||||
import { Utils } from "../../Utils"
|
import {Utils} from "../../Utils"
|
||||||
import { SpecialVisualization, SpecialVisualizationState } from "../SpecialVisualization"
|
import {SpecialVisualization, SpecialVisualizationState} from "../SpecialVisualization"
|
||||||
import { Store, UIEventSource } from "../../Logic/UIEventSource"
|
import {UIEventSource} from "../../Logic/UIEventSource"
|
||||||
import { Feature, LineString } from "geojson"
|
import {Feature, LineString} from "geojson"
|
||||||
import LayerConfig from "../../Models/ThemeConfig/LayerConfig"
|
import LayerConfig from "../../Models/ThemeConfig/LayerConfig"
|
||||||
|
|
||||||
export class ExportAsGpxViz implements SpecialVisualization {
|
export class ExportAsGpxViz implements SpecialVisualization {
|
||||||
|
|
|
@ -58,7 +58,7 @@ export default class WayImportButtonViz implements AutoAction, SpecialVisualizat
|
||||||
public readonly supportsAutoAction = true
|
public readonly supportsAutoAction = true
|
||||||
public readonly needsNodeDatabase = true
|
public readonly needsNodeDatabase = true
|
||||||
|
|
||||||
constr(state: SpecialVisualizationState, tagSource: UIEventSource<Record<string, string>>, argument: string[], feature: Feature, layer: LayerConfig): BaseUIElement {
|
constr(state: SpecialVisualizationState, tagSource: UIEventSource<Record<string, string>>, argument: string[], feature: Feature, _: LayerConfig): BaseUIElement {
|
||||||
const geometry = feature.geometry
|
const geometry = feature.geometry
|
||||||
if (!(geometry.type == "LineString" || geometry.type === "Polygon")) {
|
if (!(geometry.type == "LineString" || geometry.type === "Polygon")) {
|
||||||
console.error("Invalid type to import", geometry.type)
|
console.error("Invalid type to import", geometry.type)
|
||||||
|
|
|
@ -8,7 +8,6 @@ import { VariableUiElement } from "../Base/VariableUIElement"
|
||||||
import { Translation } from "../i18n/Translation"
|
import { Translation } from "../i18n/Translation"
|
||||||
import BaseUIElement from "../BaseUIElement"
|
import BaseUIElement from "../BaseUIElement"
|
||||||
import { GeoOperations } from "../../Logic/GeoOperations"
|
import { GeoOperations } from "../../Logic/GeoOperations"
|
||||||
import { OsmObject } from "../../Logic/Osm/OsmObject"
|
|
||||||
import ChangeLocationAction from "../../Logic/Osm/Actions/ChangeLocationAction"
|
import ChangeLocationAction from "../../Logic/Osm/Actions/ChangeLocationAction"
|
||||||
import MoveConfig from "../../Models/ThemeConfig/MoveConfig"
|
import MoveConfig from "../../Models/ThemeConfig/MoveConfig"
|
||||||
import ChangeTagAction from "../../Logic/Osm/Actions/ChangeTagAction"
|
import ChangeTagAction from "../../Logic/Osm/Actions/ChangeTagAction"
|
||||||
|
|
|
@ -146,7 +146,7 @@ export default class TagApplyButton implements AutoAction, SpecialVisualization
|
||||||
tags: UIEventSource<Record<string, string>>,
|
tags: UIEventSource<Record<string, string>>,
|
||||||
args: string[],
|
args: string[],
|
||||||
feature: Feature,
|
feature: Feature,
|
||||||
layer: LayerConfig
|
_: LayerConfig
|
||||||
): BaseUIElement {
|
): BaseUIElement {
|
||||||
const tagsToApply = TagApplyButton.generateTagsToApply(args[0], tags)
|
const tagsToApply = TagApplyButton.generateTagsToApply(args[0], tags)
|
||||||
const msg = args[1]
|
const msg = args[1]
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
import {UIEventSource} from "../../../Logic/UIEventSource";
|
import {UIEventSource} from "../../../Logic/UIEventSource";
|
||||||
import {Translation} from "../../i18n/Translation";
|
import {Translation} from "../../i18n/Translation";
|
||||||
import ValidatedInput from "../../InputElement/ValidatedInput.svelte";
|
import ValidatedInput from "../../InputElement/ValidatedInput.svelte";
|
||||||
import Tr from "../../Base/Tr.svelte";
|
|
||||||
import TagRenderingConfig from "../../../Models/ThemeConfig/TagRenderingConfig";
|
import TagRenderingConfig from "../../../Models/ThemeConfig/TagRenderingConfig";
|
||||||
import Inline from "./Inline.svelte";
|
import Inline from "./Inline.svelte";
|
||||||
import {createEventDispatcher, onDestroy} from "svelte";
|
import {createEventDispatcher, onDestroy} from "svelte";
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
import { Utils } from "../../Utils"
|
|
||||||
import { Feature } from "geojson"
|
|
||||||
import { Point } from "@turf/turf"
|
|
||||||
import { GeoLocationPointProperties } from "../../Logic/State/GeoLocationState"
|
|
||||||
import UploadTraceToOsmUI from "../BigComponents/UploadTraceToOsmUI"
|
import UploadTraceToOsmUI from "../BigComponents/UploadTraceToOsmUI"
|
||||||
import { SpecialVisualization, SpecialVisualizationState } from "../SpecialVisualization"
|
import { SpecialVisualization, SpecialVisualizationState } from "../SpecialVisualization"
|
||||||
import { UIEventSource } from "../../Logic/UIEventSource"
|
import { UIEventSource } from "../../Logic/UIEventSource"
|
||||||
|
@ -18,8 +14,8 @@ export class UploadToOsmViz implements SpecialVisualization {
|
||||||
|
|
||||||
constr(
|
constr(
|
||||||
state: SpecialVisualizationState,
|
state: SpecialVisualizationState,
|
||||||
featureTags: UIEventSource<Record<string, string>>,
|
_: UIEventSource<Record<string, string>>,
|
||||||
args: string[]
|
__: string[]
|
||||||
) {
|
) {
|
||||||
const locations = state.historicalUserLocations.features.data
|
const locations = state.historicalUserLocations.features.data
|
||||||
return new UploadTraceToOsmUI((title) => GeoOperations.toGpx(locations, title), state, {
|
return new UploadTraceToOsmUI((title) => GeoOperations.toGpx(locations, title), state, {
|
||||||
|
|
|
@ -64,7 +64,7 @@ import {SaveButton} from "./Popup/SaveButton"
|
||||||
import Lazy from "./Base/Lazy"
|
import Lazy from "./Base/Lazy"
|
||||||
import {CheckBox} from "./Input/Checkboxes"
|
import {CheckBox} from "./Input/Checkboxes"
|
||||||
import Slider from "./Input/Slider"
|
import Slider from "./Input/Slider"
|
||||||
import {OsmId, OsmTags, WayId} from "../Models/OsmFeature"
|
import {OsmTags, WayId} from "../Models/OsmFeature"
|
||||||
import MoveWizard from "./Popup/MoveWizard"
|
import MoveWizard from "./Popup/MoveWizard"
|
||||||
import SplitRoadWizard from "./Popup/SplitRoadWizard"
|
import SplitRoadWizard from "./Popup/SplitRoadWizard"
|
||||||
import {ExportAsGpxViz} from "./Popup/ExportAsGpxViz"
|
import {ExportAsGpxViz} from "./Popup/ExportAsGpxViz"
|
||||||
|
@ -74,7 +74,6 @@ import {PointImportButtonViz} from "./Popup/ImportButtons/PointImportButtonViz";
|
||||||
import WayImportButtonViz from "./Popup/ImportButtons/WayImportButtonViz";
|
import WayImportButtonViz from "./Popup/ImportButtons/WayImportButtonViz";
|
||||||
import ConflateImportButtonViz from "./Popup/ImportButtons/ConflateImportButtonViz";
|
import ConflateImportButtonViz from "./Popup/ImportButtons/ConflateImportButtonViz";
|
||||||
import DeleteWizard from "./Popup/DeleteFlow/DeleteWizard.svelte";
|
import DeleteWizard from "./Popup/DeleteFlow/DeleteWizard.svelte";
|
||||||
import {UIElement} from "./UIElement";
|
|
||||||
|
|
||||||
class NearbyImageVis implements SpecialVisualization {
|
class NearbyImageVis implements SpecialVisualization {
|
||||||
// Class must be in SpecialVisualisations due to weird cyclical import that breaks the tests
|
// Class must be in SpecialVisualisations due to weird cyclical import that breaks the tests
|
||||||
|
|
|
@ -41,9 +41,7 @@
|
||||||
import Svg from "../Svg";
|
import Svg from "../Svg";
|
||||||
import {ShareScreen} from "./BigComponents/ShareScreen";
|
import {ShareScreen} from "./BigComponents/ShareScreen";
|
||||||
import ThemeIntroPanel from "./BigComponents/ThemeIntroPanel.svelte";
|
import ThemeIntroPanel from "./BigComponents/ThemeIntroPanel.svelte";
|
||||||
import type {Readable} from "svelte/store";
|
|
||||||
import type {RasterLayerPolygon} from "../Models/RasterLayers";
|
import type {RasterLayerPolygon} from "../Models/RasterLayers";
|
||||||
import RasterLayerPicker from "./Map/RasterLayerPicker.svelte";
|
|
||||||
import RasterLayerOverview from "./Map/RasterLayerOverview.svelte";
|
import RasterLayerOverview from "./Map/RasterLayerOverview.svelte";
|
||||||
import IfHidden from "./Base/IfHidden.svelte";
|
import IfHidden from "./Base/IfHidden.svelte";
|
||||||
import {onDestroy} from "svelte";
|
import {onDestroy} from "svelte";
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import { UIEventSource } from "../../Logic/UIEventSource"
|
|
||||||
|
|
||||||
export interface WikipediaBoxOptions {
|
export interface WikipediaBoxOptions {
|
||||||
addHeader?: boolean
|
addHeader?: boolean
|
||||||
firstParagraphOnly?: true | boolean
|
firstParagraphOnly?: true | boolean
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { FullWikipediaDetails } from "../../Logic/Web/Wikipedia";
|
import type { FullWikipediaDetails } from "../../Logic/Web/Wikipedia";
|
||||||
import { Store } from "../../Logic/UIEventSource";
|
import { Store } from "../../Logic/UIEventSource";
|
||||||
import { onDestroy } from "svelte";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Small helper
|
* Small helper
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import ScriptUtils from "./ScriptUtils"
|
import ScriptUtils from "./ScriptUtils"
|
||||||
import { appendFileSync, readFileSync, writeFileSync } from "fs"
|
import { appendFileSync, readFileSync, writeFileSync } from "fs"
|
||||||
import { OsmObject } from "../Logic/Osm/OsmObject"
|
|
||||||
import OsmObjectDownloader from "../Logic/Osm/OsmObjectDownloader";
|
import OsmObjectDownloader from "../Logic/Osm/OsmObjectDownloader";
|
||||||
|
|
||||||
ScriptUtils.fixUtils()
|
ScriptUtils.fixUtils()
|
||||||
|
|
|
@ -9,7 +9,7 @@ import {Or} from "../Logic/Tags/Or"
|
||||||
import {AllKnownLayouts} from "../Customizations/AllKnownLayouts"
|
import {AllKnownLayouts} from "../Customizations/AllKnownLayouts"
|
||||||
import * as OsmToGeoJson from "osmtogeojson"
|
import * as OsmToGeoJson from "osmtogeojson"
|
||||||
import MetaTagging from "../Logic/MetaTagging"
|
import MetaTagging from "../Logic/MetaTagging"
|
||||||
import {ImmutableStore, UIEventSource} from "../Logic/UIEventSource"
|
import {UIEventSource} from "../Logic/UIEventSource"
|
||||||
import {TileRange, Tiles} from "../Models/TileRange"
|
import {TileRange, Tiles} from "../Models/TileRange"
|
||||||
import LayoutConfig from "../Models/ThemeConfig/LayoutConfig"
|
import LayoutConfig from "../Models/ThemeConfig/LayoutConfig"
|
||||||
import ScriptUtils from "./ScriptUtils"
|
import ScriptUtils from "./ScriptUtils"
|
||||||
|
@ -22,7 +22,7 @@ import SimpleMetaTaggers, {ReferencingWaysMetaTagger} from "../Logic/SimpleMetaT
|
||||||
import FilteringFeatureSource from "../Logic/FeatureSource/Sources/FilteringFeatureSource"
|
import FilteringFeatureSource from "../Logic/FeatureSource/Sources/FilteringFeatureSource"
|
||||||
import {Feature} from "geojson"
|
import {Feature} from "geojson"
|
||||||
import {BBox} from "../Logic/BBox"
|
import {BBox} from "../Logic/BBox"
|
||||||
import {FeatureSource, FeatureSourceForLayer} from "../Logic/FeatureSource/FeatureSource";
|
import {FeatureSource} from "../Logic/FeatureSource/FeatureSource";
|
||||||
import OsmObjectDownloader from "../Logic/Osm/OsmObjectDownloader";
|
import OsmObjectDownloader from "../Logic/Osm/OsmObjectDownloader";
|
||||||
import FeaturePropertiesStore from "../Logic/FeatureSource/Actors/FeaturePropertiesStore";
|
import FeaturePropertiesStore from "../Logic/FeatureSource/Actors/FeaturePropertiesStore";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import * as fs from "fs"
|
import * as fs from "fs"
|
||||||
import Constants from "../Models/Constants";
|
|
||||||
|
|
||||||
function genImages(dryrun = false) {
|
function genImages(dryrun = false) {
|
||||||
console.log("Generating images")
|
console.log("Generating images")
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
import { Utils } from "../../../Utils"
|
import {Utils} from "../../../Utils"
|
||||||
import LayoutConfig from "../../../Models/ThemeConfig/LayoutConfig"
|
import LayoutConfig from "../../../Models/ThemeConfig/LayoutConfig"
|
||||||
import SelectedElementTagsUpdater from "../../../Logic/Actors/SelectedElementTagsUpdater"
|
|
||||||
|
|
||||||
import * as bookcaseJson from "../../../assets/generated/themes/bookcases.json"
|
import * as bookcaseJson from "../../../assets/generated/themes/bookcases.json"
|
||||||
import { OsmTags } from "../../../Models/OsmFeature"
|
import {OsmTags} from "../../../Models/OsmFeature"
|
||||||
import { Feature, Geometry } from "geojson"
|
import {Feature, Geometry} from "geojson"
|
||||||
import { expect, it } from "vitest"
|
import {expect, it} from "vitest"
|
||||||
import ThemeViewState from "../../../Models/ThemeViewState"
|
import ThemeViewState from "../../../Models/ThemeViewState"
|
||||||
import ScriptUtils from "../../../scripts/ScriptUtils";
|
import ScriptUtils from "../../../scripts/ScriptUtils";
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue