forked from MapComplete/MapComplete
Docs: create overview of online services (for F-Droid acceptance); inline ELI again
This commit is contained in:
parent
1a75823f17
commit
e9209f6b7c
26 changed files with 1099 additions and 298 deletions
|
|
@ -7,6 +7,7 @@ import ImageProvider, { ProvidedImage } from "./ImageProvider"
|
|||
import { WikidataImageProvider } from "./WikidataImageProvider"
|
||||
import Panoramax from "./Panoramax"
|
||||
import { Utils } from "../../Utils"
|
||||
import { ServerSourceInfo } from "../../Models/SourceOverview"
|
||||
|
||||
/**
|
||||
* A generic 'from the interwebz' image picker, without attribution
|
||||
|
|
@ -33,9 +34,17 @@ export default class AllImageProviders {
|
|||
Panoramax.singleton,
|
||||
AllImageProviders.genericImageProvider,
|
||||
]
|
||||
public static apiUrls: string[] = [].concat(
|
||||
public static apiUrls: (string | ServerSourceInfo)[] = [].concat(
|
||||
...AllImageProviders.imageAttributionSources.map((src) => src.apiUrls()),
|
||||
"https://panoramax-storage-public-fast.s3.gra.perf.cloud.ovh.net"
|
||||
<ServerSourceInfo>{
|
||||
url: "https://panoramax-storage-public-fast.s3.gra.perf.cloud.ovh.net",
|
||||
category: "feature",
|
||||
description: "The image data store for a French Panoramax-server. As the photosphere fetches this, must be listed in the CSP",
|
||||
moreInfo: ["http://panoramax.fr/"],
|
||||
selfhostable: true,
|
||||
openData: true,
|
||||
sourceAvailable: true,
|
||||
},
|
||||
)
|
||||
public static defaultKeys: string[] = [].concat(
|
||||
...AllImageProviders.imageAttributionSources.map((provider) => provider.defaultKeyPrefixes)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import BaseUIElement from "../../UI/BaseUIElement"
|
|||
import { LicenseInfo } from "./LicenseInfo"
|
||||
import { Utils } from "../../Utils"
|
||||
import { Feature, Point } from "geojson"
|
||||
import { ServerSourceInfo } from "../../Models/SourceOverview"
|
||||
|
||||
export interface ProvidedImage {
|
||||
url: string
|
||||
|
|
@ -126,7 +127,7 @@ export default abstract class ImageProvider {
|
|||
|
||||
public abstract DownloadAttribution(providedImage: { id: string }): Promise<LicenseInfo>
|
||||
|
||||
public abstract apiUrls(): string[]
|
||||
public abstract apiUrls(): (string | ServerSourceInfo)[]
|
||||
|
||||
/**
|
||||
* URL to visit the image on the original website
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import SvelteUIElement from "../../UI/Base/SvelteUIElement"
|
|||
import MapillaryIcon from "./MapillaryIcon.svelte"
|
||||
import { Feature, Point } from "geojson"
|
||||
import { Store, UIEventSource } from "../UIEventSource"
|
||||
import { ServerSourceInfo } from "../../Models/SourceOverview"
|
||||
|
||||
export class Mapillary extends ImageProvider {
|
||||
public static readonly singleton = new Mapillary()
|
||||
|
|
@ -117,8 +118,17 @@ export class Mapillary extends ImageProvider {
|
|||
return undefined
|
||||
}
|
||||
|
||||
apiUrls(): string[] {
|
||||
return ["https://mapillary.com", "https://www.mapillary.com", "https://graph.mapillary.com"]
|
||||
apiUrls(): ServerSourceInfo[] {
|
||||
return ["https://mapillary.com", "https://www.mapillary.com", "https://graph.mapillary.com"].map(
|
||||
url => ({
|
||||
url,
|
||||
category: "core",
|
||||
trigger: ["always"],
|
||||
sourceAvailable: "proprietary server", selfhostable: false, openData: true,
|
||||
description: "Mapillary is an online service which hosts streetview-imagery. It is used to query and show nearby images. Owned by Meta Inc. (Facebook). MapComplete does only use data, but does not recommend contributing data to Mapillary (instead, we recommend uploading to a panoramax-instance)",
|
||||
moreInfo: ["https://www.mapillary.com/about", "https://wiki.openstreetmap.org/wiki/Mapillary"],
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
SourceIcon(
|
||||
|
|
@ -143,8 +153,6 @@ export class Mapillary extends ImageProvider {
|
|||
|
||||
/**
|
||||
* Download data necessary for the 360°-viewer
|
||||
* @param pkey
|
||||
* @constructor
|
||||
*/
|
||||
public async getPanoramaInfo(image: {
|
||||
id: number | string
|
||||
|
|
@ -171,7 +179,7 @@ export class Mapillary extends ImageProvider {
|
|||
url: response.thumb_2048_url,
|
||||
northOffset: response.computed_compass_angle,
|
||||
provider: this,
|
||||
imageMeta: <any>image,
|
||||
imageMeta: image,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ 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"
|
||||
|
||||
export default class PanoramaxImageProvider extends ImageProvider {
|
||||
public static readonly singleton: PanoramaxImageProvider = new PanoramaxImageProvider()
|
||||
|
|
@ -218,8 +219,20 @@ export default class PanoramaxImageProvider extends ImageProvider {
|
|||
}
|
||||
}
|
||||
|
||||
public apiUrls(): string[] {
|
||||
return ["https://panoramax.mapcomplete.org", "https://panoramax.xyz"]
|
||||
public apiUrls(): ServerSourceInfo[] {
|
||||
return [
|
||||
Constants.panoramax,
|
||||
{
|
||||
url: "https://panoramax.xyz",
|
||||
description: "The federation instance of Panoramax, which knows all panoramax-servers and can query all servers",
|
||||
selfhostable: true,
|
||||
openData: true,
|
||||
sourceAvailable: true,
|
||||
moreInfo: ["https://wiki.openstreetmap.org/wiki/Panoramax"],
|
||||
trigger: ["always"],
|
||||
category: "core",
|
||||
|
||||
}]
|
||||
}
|
||||
|
||||
public static getPanoramaxInstance(host: string) {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import SvelteUIElement from "../../UI/Base/SvelteUIElement"
|
|||
import * as Wikidata_icon from "../../assets/svg/Wikidata.svelte"
|
||||
import { Utils } from "../../Utils"
|
||||
import { Feature, Point } from "geojson"
|
||||
import { ServerSourceInfo } from "../../Models/SourceOverview"
|
||||
|
||||
export class WikidataImageProvider extends ImageProvider {
|
||||
public static readonly singleton = new WikidataImageProvider()
|
||||
|
|
@ -20,7 +21,7 @@ export class WikidataImageProvider extends ImageProvider {
|
|||
super()
|
||||
}
|
||||
|
||||
public apiUrls(): string[] {
|
||||
public apiUrls(): ServerSourceInfo[] {
|
||||
return Wikidata.neededUrls
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ import Wikimedia from "../Web/Wikimedia"
|
|||
import SvelteUIElement from "../../UI/Base/SvelteUIElement"
|
||||
import Wikimedia_commons_white from "../../assets/svg/Wikimedia_commons_white.svelte"
|
||||
import { Feature, Point } from "geojson"
|
||||
import { ServerSourceInfo } from "../../Models/SourceOverview"
|
||||
import { describe } from "vitest"
|
||||
|
||||
/**
|
||||
* This module provides endpoints for wikimedia and others
|
||||
|
|
@ -96,8 +98,15 @@ export class WikimediaImageProvider extends ImageProvider {
|
|||
return value
|
||||
}
|
||||
|
||||
apiUrls(): string[] {
|
||||
return WikimediaImageProvider.apiUrls
|
||||
apiUrls(): ServerSourceInfo[] {
|
||||
return WikimediaImageProvider.apiUrls.map(url => <ServerSourceInfo>{
|
||||
url,
|
||||
description: "Wikimedia contains various images",
|
||||
openData: true,
|
||||
sourceAvailable: true,
|
||||
category: "core",
|
||||
selfhostable: true,
|
||||
})
|
||||
}
|
||||
|
||||
SourceIcon(): BaseUIElement {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue