Refactoring: remove old, no longer needed classes

This commit is contained in:
Pieter Vander Vennet 2025-07-11 02:14:52 +02:00
parent b8de80bee3
commit 61f20d0092
14 changed files with 60 additions and 293 deletions

View file

@ -1,10 +1,9 @@
import ImageProvider, { PanoramaView, ProvidedImage } from "./ImageProvider"
import BaseUIElement from "../../UI/BaseUIElement"
import { Utils } from "../../Utils"
import { LicenseInfo } from "./LicenseInfo"
import Constants from "../../Models/Constants"
import SvelteUIElement from "../../UI/Base/SvelteUIElement"
import MapillaryIcon from "./MapillaryIcon.svelte"
import { default as MapillaryIcon } from "./Mapillary.svelte"
import { Feature, Point } from "geojson"
import { Store, UIEventSource } from "../UIEventSource"
import { ServerSourceInfo } from "../../Models/SourceOverview"
@ -139,19 +138,8 @@ export class Mapillary extends ImageProvider {
}))
}
SourceIcon(
img: { id: string; url: string },
location?: {
lon: number
lat: number
}
): BaseUIElement {
let url: string = undefined
const id = img.id
if (id) {
url = Mapillary.createLink(location, 16, "" + id)
}
return new SvelteUIElement(MapillaryIcon, { url })
SourceIcon(): SvelteUIElement {
return new SvelteUIElement(MapillaryIcon)
}
async ExtractUrls(key: string, value: string): Promise<ProvidedImage[]> {

View file

@ -1,23 +0,0 @@
<script lang="ts">
import Mapillary from "../../assets/svg/Mapillary.svelte"
import { ariaLabel } from "../../Utils/ariaLabel"
import Translations from "../../UI/i18n/Translations"
/**
* Accessible, linked mapillary icon
*/
export let url: string = undefined
</script>
{#if url}
<a
href={url}
use:ariaLabel={Translations.t.general.attribution.seeOnMapillary}
target="_blank"
rel="noopener nofollower"
>
<Mapillary />
</a>
{:else}
<Mapillary />
{/if}

View file

@ -9,7 +9,6 @@ import Constants from "../../Models/Constants"
import { Store, Stores, UIEventSource } from "../UIEventSource"
import SvelteUIElement from "../../UI/Base/SvelteUIElement"
import Panoramax_bw from "../../assets/svg/Panoramax_bw.svelte"
import Link from "../../UI/Base/Link"
import { Feature, Point } from "geojson"
import { AddImageOptions } from "panoramax-js/dist/Panoramax"
import { ServerSourceInfo } from "../../Models/SourceOverview"
@ -40,23 +39,8 @@ export default class PanoramaxImageProvider extends ImageProvider {
{ data: Promise<{ data: ImageData; url: string }>; time: Date }
> = {}
public SourceIcon(
img?: { id: string; url: string },
location?: {
lon: number
lat: number
}
): BaseUIElement {
const host = "https://" + new URL(img.url).host
const p = new Panoramax(host)
return new Link(
new SvelteUIElement(Panoramax_bw),
p.createViewLink({
imageId: img?.id,
location,
}),
true
)
public SourceIcon(): SvelteUIElement {
return new SvelteUIElement(Panoramax_bw)
}
visitUrl(

View file

@ -3,7 +3,7 @@ import BaseUIElement from "../../UI/BaseUIElement"
import { WikimediaImageProvider } from "./WikimediaImageProvider"
import Wikidata from "../Web/Wikidata"
import SvelteUIElement from "../../UI/Base/SvelteUIElement"
import * as Wikidata_icon from "../../assets/svg/Wikidata.svelte"
import Wikidata_icon from "../../assets/svg/Wikidata.svelte"
import { Utils } from "../../Utils"
import { Feature, Point } from "geojson"
import { ServerSourceInfo } from "../../Models/SourceOverview"