forked from MapComplete/MapComplete
UI: improve placement of logo on small screens
This commit is contained in:
parent
d662bc2707
commit
d16dd7c4e1
5 changed files with 32 additions and 12 deletions
|
|
@ -97,7 +97,7 @@ class LinkedDataFromWebsite extends SpecialVisualization {
|
|||
funcName = "linked_data_from_website"
|
||||
group = "data_import"
|
||||
docs =
|
||||
"Attempts to load (via a proxy) the specified website and parsed ld+json from there. Suitable data will be offered to import into OSM. Note: this element is added by default"
|
||||
"Attempts to load (via a proxy) the specified website and parsed ld+json from there. Suitable data will be offered to import into OSM. Note: this element is added by default; but is disabled if the theme has the 'more privacy' flag set"
|
||||
args = [
|
||||
{
|
||||
name: "key",
|
||||
|
|
@ -146,12 +146,16 @@ class LinkedDataFromWebsite extends SpecialVisualization {
|
|||
argument: string[],
|
||||
feature: Feature,
|
||||
layer: LayerConfig
|
||||
): BaseUIElement {
|
||||
): SvelteUIElement {
|
||||
if(state.theme.enableMorePrivacy){
|
||||
return undefined
|
||||
}
|
||||
|
||||
const key = argument[0] ?? "website"
|
||||
const useProxy = argument[1] !== "no"
|
||||
const readonly = argument[3] === "readonly"
|
||||
const isClosed = (argument[4] ?? "yes") === "yes"
|
||||
|
||||
const downloadInformation = new UIEventSource(false)
|
||||
const countryStore: Store<string | undefined> = tags.mapD((tags) => tags._country)
|
||||
const sourceUrl: Store<string | undefined> = tags.mapD((tags) => {
|
||||
if (!tags[key] || tags[key] === "undefined") {
|
||||
|
|
@ -161,6 +165,9 @@ class LinkedDataFromWebsite extends SpecialVisualization {
|
|||
})
|
||||
const externalData: Store<{ success: GeoJsonProperties } | { error }> = sourceUrl.bindD(
|
||||
(url) => {
|
||||
if(!downloadInformation.data){
|
||||
return undefined
|
||||
}
|
||||
const country = countryStore.data
|
||||
if (url.startsWith("https://data.velopark.be/")) {
|
||||
return Stores.FromPromiseWithErr(
|
||||
|
|
@ -208,13 +215,15 @@ class LinkedDataFromWebsite extends SpecialVisualization {
|
|||
})()
|
||||
)
|
||||
},
|
||||
[countryStore]
|
||||
[countryStore, downloadInformation]
|
||||
)
|
||||
|
||||
externalData.addCallbackAndRunD((lod) =>
|
||||
console.log("linked_data_from_website received the following data:", lod)
|
||||
)
|
||||
|
||||
|
||||
|
||||
return new SvelteUIElement(ComparisonTool, {
|
||||
feature,
|
||||
state,
|
||||
|
|
@ -223,6 +232,7 @@ class LinkedDataFromWebsite extends SpecialVisualization {
|
|||
externalData,
|
||||
sourceUrl,
|
||||
readonly,
|
||||
downloadInformation,
|
||||
collapsed: isClosed,
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue