diff --git a/Docs/OnlineServicesOverview.md b/Docs/OnlineServicesOverview.md
index 3de1740f4a..0d7f1d9ab6 100644
--- a/Docs/OnlineServicesOverview.md
+++ b/Docs/OnlineServicesOverview.md
@@ -2,14 +2,18 @@
# Overview of used online services
+This document list all the hosts that MapComplete might contact via 'fetch'-requests for various API services. We do our best to use FLOSS- and/or self-hostable services as much as possible.
+
## Table of contents
1. [core](#core)
- [About displayed images](#about-displayed-images)
- [geofabrik.de](#geofabrikde)
+ - [imgur.com](#imgurcom)
- [komoot.io](#komootio)
- [mapcomplete.org](#mapcompleteorg)
- [mapillary.com](#mapillarycom)
+ - [openstreetmap.fr](#openstreetmapfr)
- [openstreetmap.org](#openstreetmaporg)
- [osm.jp](#osmjp)
- [overpass-api.de](#overpass-apide)
@@ -17,6 +21,9 @@
- [private.coffee](#privatecoffee)
- [wikimedia.org](#wikimediaorg)
2. [feature](#feature)
+ - [flickr.com](#flickrcom)
+ - [mangrove.reviews](#mangrovereviews)
+ - [maproulette.org](#maprouletteorg)
- [ovh.net](#ovhnet)
- [plantnet.org](#plantnetorg)
- [velopark.be](#veloparkbe)
@@ -24,9 +31,13 @@
3. [maplayer](#maplayer)
4. [No category](#no-category)
+Some of the core services (especially Panoramax and MapLibre) could be selfhosted, but MapComplete has no support for a user to configure a different host. Right now, the userbase is relatively small and there is little demand to make this configurable, but the technical cost for this is quite high. Someone who wishes to use a different service, is able to build a fork.
+
+One service that is hard to replace, is [*Mapillary*](https://wiki.openstreetmap.org/wiki/Mapillary). It contains a vast trove of streetview data, but cannot be selfhosted and is currently owned by Meta Inc. We use this to find nearby images of features, but promote the use of [Panoramax](https://wiki.openstreetmap.org/wiki/Panoramax) instead (both by uploading contributions to our panoramax-instance and by lobbying in the community for this)
+
## core
-20 items
+23 items
Core features are always active and will be contacted as soon as you visit any map
@@ -42,6 +53,14 @@ Nominatim search engine endpoint, used when searching
-----|----- |
| https://geocoding.geofabrik.de/b75350b1cfc34962ac49824fe5b582dc/ | OpenData, source available, self hostable, https://wiki.openstreetmap.org/wiki/Nominatim |
+### imgur.com
+
+[Legacy] If an image is stored on imgur, read the description and attempt to get a license out of it. Most (if not all) have moved
+
+| source |
+----- |
+| https://api.imgur.com/3/image |
+
### komoot.io
Endpoint for search with photon
@@ -60,18 +79,24 @@ Endpoint for search with photon
| https://report.mapcomplete.org/report | If a severe error occurs in MapComplete, this is logged on this server - this mostly concerns errors where making a change to OpenStreetMap failed. Data is handled confidentially and _only_ to replay the change and fix the root cause. | OpenData, yes, |
| https://countrycoder.mapcomplete.org | For quite some functions, we need to know in what _country_ a feature is located. LatLon2Country is a static dataset, which, by cleverly encoding the data, can quickly tell in what country a feature is located. | OpenData, source available, self hostable, https://source.mapcomplete.org/MapComplete/latlon2country |
| https://data.mapcomplete.org/nsi | Contains a copy and the logos of the Name Suggestion Index | |
-| https://panoramax.mapcomplete.org | The panoramax-server that MapComplete uploads to | OpenData, source available, self hostable, https://wiki.openstreetmap.org/wiki/Panoramax |
+| https://panoramax.mapcomplete.org | Various endpoints to load images from panoramax | OpenData, source available, self hostable, |
| https://lod.mapcomplete.org/extractgraph?url={url} | This proxy queries websites to detect if they contain linked open data and gives this data back. Triggered by opening a feature | OpenData, source available, self hostable, https://source.mapcomplete.org/MapComplete/MapComplete/src/branch/develop/scripts/serverLdScrape.ts |
### mapillary.com
-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)
+| source | description | license;selfhosting;more info |
+-----|-----|----- |
+| https://graph.mapillary.com | API endpoint of Mapillary to query which images are nearby | OpenData, https://wiki.openstreetmap.org/wiki/Mapillary |
+| https://mapillary.com | 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) | OpenData, proprietary server, https://www.mapillary.com/about , https://wiki.openstreetmap.org/wiki/Mapillary |
+| https://www.mapillary.com | 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) | OpenData, proprietary server, https://www.mapillary.com/about , https://wiki.openstreetmap.org/wiki/Mapillary |
+
+### openstreetmap.fr
+
+Various endpoints to load images from panoramax
| source | license;selfhosting;more info |
-----|----- |
-| https://mapillary.com | OpenData, proprietary server, https://www.mapillary.com/about , https://wiki.openstreetmap.org/wiki/Mapillary |
-| https://www.mapillary.com | OpenData, proprietary server, https://www.mapillary.com/about , https://wiki.openstreetmap.org/wiki/Mapillary |
-| https://graph.mapillary.com | OpenData, proprietary server, https://www.mapillary.com/about , https://wiki.openstreetmap.org/wiki/Mapillary |
+| https://panoramax.openstreetmap.fr | OpenData, source available, self hostable, |
### openstreetmap.org
@@ -99,11 +124,10 @@ Overpass is a query service where OpenStreetMap-data can be retrieved. Various o
### panoramax.xyz
-The federation instance of Panoramax, which knows all panoramax-servers and can query all servers
-
-| source | license;selfhosting;more info |
------|----- |
-| https://panoramax.xyz | OpenData, source available, self hostable, https://wiki.openstreetmap.org/wiki/Panoramax |
+| source | description | license;selfhosting;more info |
+-----|-----|----- |
+| https://api.panoramax.xyz | Various endpoints to load images from panoramax | OpenData, source available, self hostable, |
+| https://panoramax.xyz | The federation instance of Panoramax, which knows all panoramax-servers and can query all servers | OpenData, source available, self hostable, https://wiki.openstreetmap.org/wiki/Panoramax |
### private.coffee
@@ -124,10 +148,34 @@ Wikimedia contains various images
## feature
-15 items
+10 items
These are only enabled for certain maps or certain features
+### flickr.com
+
+API endpoint to fetch 'nearby images'
+
+| source | license;selfhosting;more info |
+-----|----- |
+| https://api.flickr.com | OpenData, |
+
+### mangrove.reviews
+
+Mangrove.reviews, part of the 'Open Review Association' allows to create reviews. All reviews are under a creative commons license
+
+| source | license;selfhosting;more info |
+-----|----- |
+| https://api.mangrove.reviews | OpenData, source available, selfhostable, but network effects diminish the value, https://gitlab.com/open-reviews/mangrove , https://mangrove.reviews/ , https://wiki.openstreetmap.org/wiki/Open_Reviews_Association |
+
+### maproulette.org
+
+[MapRoulette](https://wiki.openstreetmap.org/wiki/MapRoulette) is a platform where tasks can be submitted, where every task contains some data about something that should be improved in OpenStreetMap. The intent is that those 'tasks' are solved by the community, effectively working as big, shared 'todo'-list. MapComplete can display such tasks and mark them solved. This is most often done to run an import of data.
+
+| source | license;selfhosting;more info |
+-----|----- |
+| https://maproulette.org/api/v2 | OpenData, source available, self hostable, |
+
### ovh.net
The image data store for a French Panoramax-server. As the photosphere fetches this, must be listed in the CSP
@@ -162,14 +210,6 @@ MapComplete checks wikidata to find images to show and displays information from
| https://wikidata.org/ | OpenData, source available, yes, but useless due to network effects, |
| https://query.wikidata.org | OpenData, source available, yes, but useless due to network effects, |
| https://m.wikidata.org | OpenData, source available, yes, but useless due to network effects, |
-| https://www.wikidata.org/ | OpenData, source available, yes, but useless due to network effects, |
-| https://wikidata.org/ | OpenData, source available, yes, but useless due to network effects, |
-| https://query.wikidata.org | OpenData, source available, yes, but useless due to network effects, |
-| https://m.wikidata.org | OpenData, source available, yes, but useless due to network effects, |
-| https://www.wikidata.org/ | OpenData, source available, yes, but useless due to network effects, |
-| https://wikidata.org/ | OpenData, source available, yes, but useless due to network effects, |
-| https://query.wikidata.org | OpenData, source available, yes, but useless due to network effects, |
-| https://m.wikidata.org | OpenData, source available, yes, but useless due to network effects, |
## maplayer
@@ -446,35 +486,7 @@ A full listing can be found in [ELI-overview](ELI-overview.md)
## No category
-27 items
-
- - https://www.openstreetmap.org
- - https://api.openstreetmap.org
- - https://panoramax.mapcomplete.org
- - https://api.flickr.com
- - https://api.imgur.com/3/image
- - https://i.imgur.com
- - *.fbcdn.net
- - https://graph.mapillary.com
- - https://panoramax.openstreetmap.fr
- - https://api.panoramax.xyz
- - https://panoramax.mapcomplete.org
- - https://api.imgur.com/3/image
- - https://panoramax.mapcomplete.org
- - https://www.openstreetmap.org
- - https://www.openstreetmap.org
- - https://www.openstreetmap.org
- - https://api.imgur.com/3/image
- - https://i.imgur.com
- - https://www.openstreetmap.org
- - https://www.openstreetmap.org
- - https://api.mangrove.reviews
- - https://api.mangrove.reviews
- - https://api.mangrove.reviews
- - https://maproulette.org/api/v2
- - *.wikipedia.org
- - https://countrycoder.mapcomplete.org
- - https://www.openstreetmap.org
+0 items
diff --git a/Docs/SpecialRenderings.md b/Docs/SpecialRenderings.md
index 559da31a9e..9d3effc6f2 100644
--- a/Docs/SpecialRenderings.md
+++ b/Docs/SpecialRenderings.md
@@ -800,7 +800,7 @@ Adds an image to a node
-----|-----|----- |
| Id-key | id | The property name where the ID of the note to close can be found |
-Defined in [/src/UI/SpecialVisualisations/NoteVisualisations.ts#L123](/src/UI/SpecialVisualisations/NoteVisualisations.ts#L123)
+Defined in [/src/UI/SpecialVisualisations/NoteVisualisations.ts#L124](/src/UI/SpecialVisualisations/NoteVisualisations.ts#L124)
#### Example usage of add_image_to_note
@@ -814,7 +814,7 @@ A textfield to add a comment to a node (with the option to close the note).
-----|-----|----- |
| Id-key | id | The property name where the ID of the note to close can be found |
-Defined in [/src/UI/SpecialVisualisations/NoteVisualisations.ts#L81](/src/UI/SpecialVisualisations/NoteVisualisations.ts#L81)
+Defined in [/src/UI/SpecialVisualisations/NoteVisualisations.ts#L82](/src/UI/SpecialVisualisations/NoteVisualisations.ts#L82)
#### Example usage of add_note_comment
@@ -833,7 +833,7 @@ Button to close a note. A predefined text can be defined to close the note with.
| minZoom | _undefined_ | If set, only show the closenote button if zoomed in enough |
| zoomButton | _undefined_ | Text to show if not zoomed in enough |
-Defined in [/src/UI/SpecialVisualisations/NoteVisualisations.ts#L22](/src/UI/SpecialVisualisations/NoteVisualisations.ts#L22)
+Defined in [/src/UI/SpecialVisualisations/NoteVisualisations.ts#L23](/src/UI/SpecialVisualisations/NoteVisualisations.ts#L23)
#### Example usage of close_note
@@ -843,7 +843,7 @@ Defined in [/src/UI/SpecialVisualisations/NoteVisualisations.ts#L22](/src/UI/Spe
Creates a new map note on the given location. This options is placed in the 'last_click'-popup automatically if the 'notes'-layer is enabled
-Defined in [/src/UI/SpecialVisualisations/NoteVisualisations.ts#L102](/src/UI/SpecialVisualisations/NoteVisualisations.ts#L102)
+Defined in [/src/UI/SpecialVisualisations/NoteVisualisations.ts#L103](/src/UI/SpecialVisualisations/NoteVisualisations.ts#L103)
#### Example usage of open_note
@@ -858,7 +858,7 @@ Visualises the comments for notes
| commentsKey | comments | The property name of the comments, which should be stringified json |
| start | 0 | Drop the first 'start' comments |
-Defined in [/src/UI/SpecialVisualisations/NoteVisualisations.ts#L143](/src/UI/SpecialVisualisations/NoteVisualisations.ts#L143)
+Defined in [/src/UI/SpecialVisualisations/NoteVisualisations.ts#L144](/src/UI/SpecialVisualisations/NoteVisualisations.ts#L144)
#### Example usage of visualize_note_comments
@@ -878,7 +878,7 @@ Invites the contributor to leave a review. Somewhat small UI-element until inter
| fallback | _undefined_ | The identifier to use, if tags[subjectKey] as specified above is not available. This is effectively a fallback value |
| question | _undefined_ | The question to ask during the review |
-Defined in [/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts#L15](/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts#L15)
+Defined in [/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts#L16](/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts#L16)
#### Example usage of create_review
@@ -893,7 +893,7 @@ Adds an overview of the mangrove-reviews of this object. Mangrove.Reviews needs
| subjectKey | name | The key to use to determine the subject. If specified, the subject will be tags[subjectKey] |
| fallback | _undefined_ | The identifier to use, if tags[subjectKey] as specified above is not available. This is effectively a fallback value |
-Defined in [/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts#L62](/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts#L62)
+Defined in [/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts#L74](/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts#L74)
#### Example usage of list_reviews
@@ -908,7 +908,7 @@ Shows stars which represent the average rating on mangrove.
| subjectKey | name | The key to use to determine the subject. If the value is specified, the subject will be tags[subjectKey] and will use this to filter the reviews. |
| fallback | _undefined_ | The identifier to use, if tags[subjectKey] as specified above is not available. This is effectively a fallback value |
-Defined in [/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts#L97](/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts#L97)
+Defined in [/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts#L109](/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts#L109)
#### Example usage of rating
@@ -924,7 +924,7 @@ A pragmatic combination of `create_review` and `list_reviews`
| fallback | _undefined_ | The identifier to use, if tags[subjectKey] as specified above is not available. This is effectively a fallback value |
| question | _undefined_ | The question to ask in the review form. Optional |
-Defined in [/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts#L155](/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts#L155)
+Defined in [/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts#L167](/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts#L167)
#### Example usage of reviews
@@ -996,7 +996,7 @@ Only makes sense in the usersettings. Allows to import a mangrove public key and
-----|-----|----- |
| text | _undefined_ | The text that is shown on the button |
-Defined in [/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts#L133](/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts#L133)
+Defined in [/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts#L145](/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts#L145)
#### Example usage of import_mangrove_key
@@ -1377,7 +1377,7 @@ Defined in [/src/UI/Popup/DataVisualisations.ts#L291](/src/UI/Popup/DataVisualis
Uploads the GPS-history as GPX to OpenStreetMap.org; clears the history afterwards. The actual feature is ignored.
-Defined in [/src/UI/Popup/UploadToOsmViz.ts#L11](/src/UI/Popup/UploadToOsmViz.ts#L11)
+Defined in [/src/UI/Popup/UploadToOsmViz.ts#L12](/src/UI/Popup/UploadToOsmViz.ts#L12)
#### Example usage of upload_to_osm
diff --git a/scripts/generateDocs.ts b/scripts/generateDocs.ts
index 0423d3a5aa..8eadd39c8f 100644
--- a/scripts/generateDocs.ts
+++ b/scripts/generateDocs.ts
@@ -543,10 +543,14 @@ export class GenerateDocs extends Script {
const sources = await new SourceOverview().getOverview()
const md = [
"# Overview of used online services",
+ "This document list all the hosts that MapComplete might contact via 'fetch'-requests for various API services. We do our best to use FLOSS- and/or self-hostable services as much as possible.",
+ "Some of the core services (especially Panoramax and MapLibre) could be selfhosted, but MapComplete has no support for a user to configure a different host. Right now, the userbase is relatively small and there is little demand to make this configurable, but the technical cost for this is quite high. Someone who wishes to use a different service, is able to build a fork.",
+ "One service that is hard to replace, is [*Mapillary*](https://wiki.openstreetmap.org/wiki/Mapillary). It contains a vast trove of streetview data, but cannot be selfhosted and is currently owned by Meta Inc. We use this to find nearby images of features, but promote the use of [Panoramax](https://wiki.openstreetmap.org/wiki/Panoramax) instead (both by uploading contributions to our panoramax-instance and by lobbying in the community for this)"
]
- const serverInfos = sources.filter(s => typeof s !== "string")
+ const serverInfosDupl = sources.filter(s => typeof s !== "string")
.filter(item => typeof item === "string" || item.url.startsWith("https://") || item.url.startsWith("pmtiles://"))
+ const serverInfos = Utils.DedupOnId(serverInfosDupl, item => item.url)
const titles = Utils.Dedup(Utils.NoEmpty(serverInfos.map(s => s.category)))
titles.sort()
@@ -571,6 +575,7 @@ export class GenerateDocs extends Script {
].join("\n\n"),
}
+const seenUrls = new Set()
for (const title of titles) {
md.push("## " + title)
const items = serverInfos.filter(info => info.category.toLowerCase() === title.toLowerCase())
@@ -610,6 +615,7 @@ export class GenerateDocs extends Script {
sourceAvailable = "source available"
}
}
+ seenUrls.add(item.url)
return [
item.url,
identicalDescription ? "" : item.description,
@@ -631,7 +637,7 @@ export class GenerateDocs extends Script {
}
md.push("## No category")
- const urls: string[] = sources.filter(s => typeof s === "string")
+ const urls: string[] = sources.filter(s => typeof s === "string" && !seenUrls.has(s))
md.push(urls.length + " items")
md.push(MarkdownUtils.list(urls))
diff --git a/src/Logic/ImageProviders/AllImageProviders.ts b/src/Logic/ImageProviders/AllImageProviders.ts
index 7e324c4399..65df491552 100644
--- a/src/Logic/ImageProviders/AllImageProviders.ts
+++ b/src/Logic/ImageProviders/AllImageProviders.ts
@@ -34,7 +34,7 @@ export default class AllImageProviders {
Panoramax.singleton,
AllImageProviders.genericImageProvider,
]
- public static apiUrls: (string | ServerSourceInfo)[] = [].concat(
+ public static apiUrls: ServerSourceInfo[] = [].concat(
...AllImageProviders.imageAttributionSources.map((src) => src.apiUrls()),
{
url: "https://panoramax-storage-public-fast.s3.gra.perf.cloud.ovh.net",
diff --git a/src/Logic/ImageProviders/GenericImageProvider.ts b/src/Logic/ImageProviders/GenericImageProvider.ts
index 1c5d65ed0c..e69f193300 100644
--- a/src/Logic/ImageProviders/GenericImageProvider.ts
+++ b/src/Logic/ImageProviders/GenericImageProvider.ts
@@ -1,10 +1,11 @@
import ImageProvider, { ProvidedImage } from "./ImageProvider"
+import { ServerSourceInfo } from "../../Models/SourceOverview"
export default class GenericImageProvider extends ImageProvider {
public defaultKeyPrefixes: string[] = ["image"]
public readonly name = "Generic"
- public apiUrls(): string[] {
+ public apiUrls(): ServerSourceInfo[] {
return []
}
diff --git a/src/Logic/ImageProviders/ImageProvider.ts b/src/Logic/ImageProviders/ImageProvider.ts
index e894eb7f5b..a41a98a3b6 100644
--- a/src/Logic/ImageProviders/ImageProvider.ts
+++ b/src/Logic/ImageProviders/ImageProvider.ts
@@ -127,7 +127,7 @@ export default abstract class ImageProvider {
public abstract DownloadAttribution(providedImage: { id: string }): Promise
- public abstract apiUrls(): (string | ServerSourceInfo)[]
+ public abstract apiUrls(): ServerSourceInfo[]
/**
* URL to visit the image on the original website
diff --git a/src/Logic/ImageProviders/Imgur.ts b/src/Logic/ImageProviders/Imgur.ts
index b1303b0804..3c2bb2c05e 100644
--- a/src/Logic/ImageProviders/Imgur.ts
+++ b/src/Logic/ImageProviders/Imgur.ts
@@ -3,6 +3,7 @@ import BaseUIElement from "../../UI/BaseUIElement"
import { Utils } from "../../Utils"
import Constants from "../../Models/Constants"
import { LicenseInfo } from "./LicenseInfo"
+import { ServerSourceInfo } from "../../Models/SourceOverview"
export class Imgur extends ImageProvider {
public static readonly defaultValuePrefix = ["https://i.imgur.com"]
@@ -10,14 +11,19 @@ export class Imgur extends ImageProvider {
public readonly name = "Imgur"
public readonly defaultKeyPrefixes: string[] = ["image"]
public static readonly apiUrl = "https://api.imgur.com/3/image"
- public static readonly supportingUrls = ["https://i.imgur.com"]
+ public static readonly apiUrlInfo: ServerSourceInfo = {
+ url: Imgur.apiUrl,
+ description: "[Legacy] If an image is stored on imgur, read the description and attempt to get a license out of it. Most (if not all) have moved",
+ category: "core",
+ trigger: ["specific_feature"],
+ }
private constructor() {
super()
}
- apiUrls(): string[] {
- return [Imgur.apiUrl]
+ apiUrls(): ServerSourceInfo[] {
+ return [Imgur.apiUrlInfo]
}
SourceIcon(): BaseUIElement {
@@ -99,7 +105,7 @@ export class Imgur extends ImageProvider {
const url = providedImage.id
const hash = url.substr("https://i.imgur.com/".length).split(/(\.jpe?g)|(\.png)/i)[0]
- const apiUrl = "https://api.imgur.com/3/image/" + hash
+ const apiUrl = Imgur.apiUrl + hash
const response = await Utils.downloadJsonCached<{
data: { description: string; datetime: string; views: number }
}>(apiUrl, 365 * 24 * 60 * 60, {
diff --git a/src/Logic/Maproulette.ts b/src/Logic/Maproulette.ts
index 4db0a5b01b..b899a3f716 100644
--- a/src/Logic/Maproulette.ts
+++ b/src/Logic/Maproulette.ts
@@ -1,5 +1,6 @@
import Constants from "../Models/Constants"
import { SpecialVisualizationState } from "../UI/SpecialVisualization"
+import { ServerSourceInfo } from "../Models/SourceOverview"
export interface MaprouletteTask {
name: string
@@ -21,7 +22,15 @@ export type MaprouletteStatus = (typeof maprouletteStatus)[number]
export default class Maproulette {
public static readonly defaultEndpoint = "https://maproulette.org/api/v2"
-
+ public static readonly defaultEndpointInfo: ServerSourceInfo = {
+ url: Maproulette.defaultEndpoint,
+ trigger: ["specific_theme"],
+ category: "feature",
+ description: "[MapRoulette](https://wiki.openstreetmap.org/wiki/MapRoulette) is a platform where tasks can be submitted, where every task contains some data about something that should be improved in OpenStreetMap. The intent is that those 'tasks' are solved by the community, effectively working as big, shared 'todo'-list. MapComplete can display such tasks and mark them solved. This is most often done to run an import of data.",
+ openData: true,
+ sourceAvailable: true,
+ selfhostable: true
+ }
public static readonly STATUS_OPEN = 0
public static readonly STATUS_FIXED = 1
public static readonly STATUS_FALSE_POSITIVE = 2
diff --git a/src/Logic/Web/NearbyImagesSearch.ts b/src/Logic/Web/NearbyImagesSearch.ts
index d656a6716c..0c0d7004fd 100644
--- a/src/Logic/Web/NearbyImagesSearch.ts
+++ b/src/Logic/Web/NearbyImagesSearch.ts
@@ -7,9 +7,9 @@ import { BBox } from "../BBox"
import Constants from "../../Models/Constants"
import { Utils } from "../../Utils"
import { Point } from "geojson"
-import { Imgur } from "../ImageProviders/Imgur"
import { ImageData, Panoramax, PanoramaxXYZ } from "panoramax-js/dist"
import { Mapillary } from "../ImageProviders/Mapillary"
+import { ServerSourceInfo } from "../../Models/SourceOverview"
interface ImageFetcher {
/**
@@ -81,7 +81,15 @@ class NearbyImageUtils {
class P4CImageFetcher implements ImageFetcher {
public static readonly services = ["flickr", "kartaview", "wikicommons"] as const
- public static readonly apiUrls = ["https://api.flickr.com"]
+ public static readonly apiUrls = [{
+ url: "https://api.flickr.com",
+ description: "API endpoint to fetch 'nearby images'",
+ category: "feature",
+ trigger: ["specific_feature"],
+ selfhostable: false,
+ openData: true,
+ sourceAvailable: false,
+ }]
private _options: { maxDaysOld: number; searchRadius: number }
public readonly name: P4CService
@@ -168,11 +176,18 @@ class ImagesFromPanoramaxFetcher implements ImageFetcher {
private readonly _radius: number
private readonly _panoramax: Panoramax
name: string = "panoramax"
- public static readonly apiUrls: ReadonlyArray = [
+ public static readonly apiUrls: ReadonlyArray = [
"https://panoramax.openstreetmap.fr",
"https://api.panoramax.xyz",
"https://panoramax.mapcomplete.org",
- ]
+ ].map(url => ({
+ url,
+ description: "Various endpoints to load images from panoramax",
+ sourceAvailable: true,
+ selfhostable: true,
+ openData: true,
+ category: "core",
+ }))
constructor(url?: string, radius: number = 50) {
this._radius = radius
@@ -260,7 +275,25 @@ class MapillaryFetcher implements ImageFetcher {
private readonly start_captured_at?: Date
private readonly end_captured_at?: Date
- static apiUrls: string[] = ["*.fbcdn.net", "https://graph.mapillary.com"]
+ static apiUrls: ServerSourceInfo[] = [{
+ url: "*.fbcdn.net",
+ description: "[Mapillary](https://wiki.openstreetmap.org/wiki/Mapillary) - owned by Meta - uses the Facebook CDN network to deliver images. As the panorama view needs to _fetch_ those images, *.fbcdn needs to be enabled as connect-source",
+ logging: "yes",
+ selfhostable: false,
+ category: "core",
+ trigger: ["specific_feature"],
+ moreInfo: ["https://wiki.openstreetmap.org/wiki/Mapillary"],
+ sourceAvailable: false,
+ openData: true,
+ }, {
+ url: "https://graph.mapillary.com",
+ description: "API endpoint of Mapillary to query which images are nearby",
+ category: "core",
+ trigger: ["specific_feature"],
+ moreInfo: ["https://wiki.openstreetmap.org/wiki/Mapillary"],
+ sourceAvailable: false,
+ openData: true,
+ }]
constructor(options?: {
panoramas?: undefined | "only" | "no"
@@ -352,8 +385,6 @@ export class CombinedFetcher {
private readonly sources: ReadonlyArray
public static apiUrls = [
...P4CImageFetcher.apiUrls,
- Imgur.apiUrl,
- ...Imgur.supportingUrls,
...MapillaryFetcher.apiUrls,
...ImagesFromPanoramaxFetcher.apiUrls,
]
diff --git a/src/Logic/Web/Wikipedia.ts b/src/Logic/Web/Wikipedia.ts
index 8ad03e7c2d..a97fe7d4b4 100644
--- a/src/Logic/Web/Wikipedia.ts
+++ b/src/Logic/Web/Wikipedia.ts
@@ -1,6 +1,7 @@
import { Utils } from "../../Utils"
import Wikidata, { WikidataResponse } from "./Wikidata"
import { Store, UIEventSource } from "../UIEventSource"
+import { ServerSourceInfo } from "../../Models/SourceOverview"
export interface FullWikipediaDetails {
articleUrl?: string
@@ -34,7 +35,15 @@ export default class Wikipedia {
private static readonly idsToRemove = ["sjabloon_zie"]
- public static readonly neededUrls = ["*.wikipedia.org"]
+ public static readonly neededUrls: ServerSourceInfo[] = [{
+ url: "*.wikipedia.org",
+ description: "All wikipedia services",
+ openData: true,
+ selfhostable: true,
+ sourceAvailable: true,
+ category: "core",
+ trigger: ["specific_theme"]
+ }]
private static readonly _cache = new Map>()
private static _fullDetailsCache = new Map>()
diff --git a/src/Models/SourceOverview.ts b/src/Models/SourceOverview.ts
index a8905c907d..df342e422f 100644
--- a/src/Models/SourceOverview.ts
+++ b/src/Models/SourceOverview.ts
@@ -14,7 +14,6 @@ import {
QuestionableTagRenderingConfigJson,
} from "../../src/Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson"
import { LayerConfigJson } from "../../src/Models/ThemeConfig/Json/LayerConfigJson"
-import { ImmutableStore } from "../../src/Logic/UIEventSource"
export interface ServerSourceInfo {
url: string
@@ -38,11 +37,6 @@ export class SourceOverview {
layoutJson?: ThemeConfigJson): Promise<(ServerSourceInfo | string)[]> {
const apiUrls: (ServerSourceInfo | string)[] = [
...Constants.allServers,
-
- "https://www.openstreetmap.org",
- "https://api.openstreetmap.org",
- "https://panoramax.mapcomplete.org",
-
{
url: "https://data.mapcomplete.org/nsi",
description: "Contains a copy and the logos of the Name Suggestion Index",
@@ -87,7 +81,6 @@ export class SourceOverview {
if (typeof item === "string") {
return true
}
- console.log(item)
return item.url?.trim()?.length > 0
})
diff --git a/src/UI/Popup/UploadToOsmViz.ts b/src/UI/Popup/UploadToOsmViz.ts
index 05821c4879..ebabf95ff4 100644
--- a/src/UI/Popup/UploadToOsmViz.ts
+++ b/src/UI/Popup/UploadToOsmViz.ts
@@ -4,6 +4,7 @@ import { GeoOperations } from "../../Logic/GeoOperations"
import Constants from "../../Models/Constants"
import SvelteUIElement from "../Base/SvelteUIElement"
import UploadTraceToOsmUI from "../BigComponents/UploadTraceToOsmUI.svelte"
+import { ServerSourceInfo } from "../../Models/SourceOverview"
/**
* Wrapper around 'UploadTraceToOsmUI'
@@ -13,7 +14,7 @@ export class UploadToOsmViz extends SpecialVisualization {
docs =
"Uploads the GPS-history as GPX to OpenStreetMap.org; clears the history afterwards. The actual feature is ignored."
args = []
- needsUrls = [Constants.osmAuthConfig.url]
+ needsUrls: ServerSourceInfo[] = [Constants.osmAuthConfig]
constr(
state: SpecialVisualizationState,
diff --git a/src/UI/SpecialVisualisations/DataImportSpecialVisualisations.ts b/src/UI/SpecialVisualisations/DataImportSpecialVisualisations.ts
index ad30c8e82f..2bf504fd17 100644
--- a/src/UI/SpecialVisualisations/DataImportSpecialVisualisations.ts
+++ b/src/UI/SpecialVisualisations/DataImportSpecialVisualisations.ts
@@ -21,7 +21,7 @@ class MaprouletteSetStatus extends SpecialVisualizationSvelte {
funcName = "maproulette_set_status"
group = "data_import"
docs = "Change the status of the given MapRoulette task"
- needsUrls = [Maproulette.defaultEndpoint]
+ needsUrls = [Maproulette.defaultEndpointInfo]
example =
" The following example sets the status to '2' (false positive)\n" +
"\n" +
diff --git a/src/UI/SpecialVisualisations/ImageVisualisations.ts b/src/UI/SpecialVisualisations/ImageVisualisations.ts
index d79db532f8..59a5c28c95 100644
--- a/src/UI/SpecialVisualisations/ImageVisualisations.ts
+++ b/src/UI/SpecialVisualisations/ImageVisualisations.ts
@@ -91,7 +91,7 @@ class ImageUpload extends SpecialVisualizationSvelte {
funcName = "image_upload"
group = "images"
docs = "Creates a button where a user can upload an image to panoramax"
- needsUrls = [Constants.panoramax.url]
+ needsUrls = [Constants.panoramax, Constants.osmAuthConfig]
args = [
{
type: "key",
diff --git a/src/UI/SpecialVisualisations/NoteVisualisations.ts b/src/UI/SpecialVisualisations/NoteVisualisations.ts
index a883914430..00c9aa2d4b 100644
--- a/src/UI/SpecialVisualisations/NoteVisualisations.ts
+++ b/src/UI/SpecialVisualisations/NoteVisualisations.ts
@@ -18,10 +18,11 @@ import UploadImage from "../Image/UploadImage.svelte"
import { VariableUiElement } from "../Base/VariableUIElement"
import Combine from "../Base/Combine"
import NoteCommentElement from "../Popup/Notes/NoteCommentElement.svelte"
+import { ServerSourceInfo } from "../../Models/SourceOverview"
class CloseNoteViz extends SpecialVisualizationSvelte {
public readonly funcName = "close_note"
- public readonly needsUrls = [Constants.osmAuthConfig.url]
+ public readonly needsUrls: ServerSourceInfo[] = [Constants.osmAuthConfig, Constants.panoramax]
public readonly docs =
"Button to close a note. A predefined text can be defined to close the note with. If the note is already closed, will show a small text."
public readonly args = [
@@ -131,7 +132,7 @@ class AddImageToNote extends SpecialVisualizationSvelte {
},
]
group = "notes"
- needsUrls = [Imgur.apiUrl, ...Imgur.supportingUrls]
+ needsUrls = []
constr(state, tags, args, feature) {
const id = tags.data[args[0] ?? "id"]
diff --git a/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts b/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts
index defb6e6823..ff8c5af926 100644
--- a/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts
+++ b/src/UI/SpecialVisualisations/ReviewSpecialVisualisations.ts
@@ -11,13 +11,25 @@ import { Feature } from "geojson"
import LayerConfig from "../../Models/ThemeConfig/LayerConfig"
import BaseUIElement from "../BaseUIElement"
import Combine from "../Base/Combine"
+import { ServerSourceInfo } from "../../Models/SourceOverview"
class CreateReview extends SpecialVisualizationSvelte {
+ public static MangroveReviewInfo : ServerSourceInfo = {
+ url : MangroveReviews.ORIGINAL_API,
+ description: "Mangrove.reviews, part of the 'Open Review Association' allows to create reviews. All reviews are under a creative commons license",
+ openData: true,
+ sourceAvailable: true,
+ selfhostable: "selfhostable, but network effects diminish the value",
+ category: "feature",
+ trigger: ["specific_feature"],
+ moreInfo: ["https://gitlab.com/open-reviews/mangrove", "https://mangrove.reviews/", "https://wiki.openstreetmap.org/wiki/Open_Reviews_Association"]
+ }
+
funcName = "create_review"
group = "reviews"
docs = "Invites the contributor to leave a review. Somewhat small UI-element until interacted"
- needsUrls = [MangroveReviews.ORIGINAL_API]
+ needsUrls = [CreateReview.MangroveReviewInfo]
args = [
{
name: "subjectKey",
@@ -64,7 +76,7 @@ class ListReview extends SpecialVisualizationSvelte {
group = "reviews"
docs = "Adds an overview of the mangrove-reviews of this object. Mangrove.Reviews needs - in order to identify the reviewed object - a coordinate and a name. By default, the name of the object is given, but this can be overwritten"
- needsUrls = [MangroveReviews.ORIGINAL_API]
+ needsUrls = [CreateReview.MangroveReviewInfo]
args = [
{
name: "subjectKey",
@@ -98,7 +110,7 @@ class Rating extends SpecialVisualizationSvelte {
funcName = "rating"
group = "reviews"
docs = "Shows stars which represent the average rating on mangrove."
- needsUrls = [MangroveReviews.ORIGINAL_API]
+ needsUrls = [CreateReview.MangroveReviewInfo]
args = [
{
name: "subjectKey",
@@ -174,6 +186,7 @@ class Reviews extends SpecialVisualization{
doc: "The question to ask in the review form. Optional",
},
]
+ needsUrls = [CreateReview.MangroveReviewInfo]
constr(
state: SpecialVisualizationState,
@@ -190,6 +203,7 @@ class Reviews extends SpecialVisualization{
}
export class ReviewSpecialVisualisations {
+
public static initList(): (SpecialVisualization & { group })[] {
return [
new Rating(),
diff --git a/src/UI/SpecialVisualization.ts b/src/UI/SpecialVisualization.ts
index 76efa97d51..243425d5fb 100644
--- a/src/UI/SpecialVisualization.ts
+++ b/src/UI/SpecialVisualization.ts
@@ -95,7 +95,7 @@ export abstract class SpecialVisualization {
*/
readonly group?: string
readonly example?: string
- readonly needsUrls?: (string | ServerSourceInfo)[] | ((args: string[]) => string | string[] | ServerSourceInfo | ServerSourceInfo[])
+ readonly needsUrls?: (ServerSourceInfo)[] | ((args: string[]) => string | string[] | ServerSourceInfo | ServerSourceInfo[])
readonly definedIn = Utils.runningFromConsole ? Utils.getLocationInCode(2) : undefined;
/**