docs:"Change the status of the given MapRoulette task",
needsUrls:[Maproulette.defaultEndpoint],
example:
" The following example sets the status to '2' (false positive)\n"+
"\n"+
"```json\n"+
"{\n"+
" \"id\": \"mark_duplicate\",\n"+
" \"render\": {\n"+
" \"special\": {\n"+
" \"type\": \"maproulette_set_status\",\n"+
" \"message\": {\n"+
" \"en\": \"Mark as not found or false positive\"\n"+
" },\n"+
" \"status\": \"2\",\n"+
" \"image\": \"close\"\n"+
" }\n"+
" }\n"+
"}\n"+
"```",
args:[
{
name:"message",
doc:"A message to show to the user"
},
{
name:"image",
doc:"Image to show",
defaultValue:"confirm"
},
{
name:"message_confirm",
doc:"What to show when the task is closed, either by the user or was already closed."
},
{
name:"status",
doc:"A statuscode to apply when the button is clicked. 1 = `close`, 2 = `false_positive`, 3 = `skip`, 4 = `deleted`, 5 = `already fixed` (on the map, e.g. for duplicates), 6 = `too hard`",
defaultValue:"1"
},
{
name:"maproulette_id",
doc:"The property name containing the maproulette id",
defaultValue:"mr_taskId"
},
{
name:"ask_feedback",
doc:"If not an empty string, this will be used as question to ask some additional feedback. A text field will be added",
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",
args:[
{
name:"key",
defaultValue:"website",
doc:"Attempt to load ld+json from the specified URL. This can be in an embedded <script type='ld+json'>"
},
{
name:"useProxy",
defaultValue:"yes",
doc:"If 'yes', uses the provided proxy server. This proxy server will scrape HTML and search for a script with `lang='ld+json'`. If `no`, the data will be downloaded and expects a linked-data-json directly"
},
{
name:"host",
doc:"If not using a proxy, define what host the website is allowed to connect to"
},
{
name:"mode",
doc:"If `display`, only show the data in tabular and readonly form, ignoring already existing tags. This is used to explicitly show all the tags. If unset or anything else, allow to apply/import on OSM"
},
{
name:"collapsed",
defaultValue:"yes",
doc:"If the containing accordion should be closed"
"Could not get with proxy/download LOD, attempting to download directly. Error for ",
url,
"is",
e
)
returnawaitLinkedDataLoader.fetchJsonLd(
url,
{country},
"fetch-raw"
)
}
})()
)
},
[countryStore]
)
externalData.addCallbackAndRunD((lod)=>
console.log("linked_data_from_website received the following data:",lod)
)
returnnewToggle(
newSvelteUIElement(ComparisonTool,{
feature,
state,
tags,
layer,
externalData,
sourceUrl,
readonly,
collapsed: isClosed
}),
undefined,
sourceUrl.map((url)=>!!url)
)
}
},
{
funcName:"compare_data",
group:"data_import",
needsUrls:(args)=>args[1].split(";"),
args:[
{
name:"url",
required: true,
doc:"The attribute containing the url where to fetch more data"
},
{
name:"host",
required: true,
doc:"The domain name(s) where data might be fetched from - this is needed to set the CSP. A domain must include 'https', e.g. 'https://example.com'. For multiple domains, separate them with ';'. If you don't know the possible domains, use '*'. "
},
{
name:"readonly",
required: false,
doc:"If 'yes', will not show 'apply'-buttons"
}
],
docs:"Gives an interactive element which shows a tag comparison between the OSM-object and the upstream object. This allows to copy some or all tags into OSM",