diff --git a/frontend/src/utils/openEditor.js b/frontend/src/utils/openEditor.js index 33ff1fe9dd..a0dff3aef3 100644 --- a/frontend/src/utils/openEditor.js +++ b/frontend/src/utils/openEditor.js @@ -135,19 +135,16 @@ function loadTasksBoundaries(project, selectedTasks) { const layerName = `Boundary for task${selectedTasks.length > 1 ? 's:' : ':'} ${selectedTasks.join( ',', )} of TM Project #${project.projectId} - Do not edit or upload`; - const emptyTaskLayerParams = { + const tmTaskLayerParams = { new_layer: true, layer_name: layerName, - data: '', - }; - const tmTaskLayerParams = { - new_layer: false, + layer_locked: true, + download_policy: "never", + upload_policy: "never", url: getTaskXmlUrl(project.projectId, selectedTasks).href, }; - return callJosmRemoteControl(formatJosmUrl('load_data', emptyTaskLayerParams)).then((result) => - callJosmRemoteControl(formatJosmUrl('import', tmTaskLayerParams)), - ); + return callJosmRemoteControl(formatJosmUrl('import', tmTaskLayerParams)); } export function getImageryInfo(url) { @@ -185,11 +182,6 @@ function loadImageryonJosm(project) { } function loadOsmDataToTasks(project, bbox, newLayer) { - const emptyOSMLayerParams = { - new_layer: newLayer, - layer_name: 'OSM Data', - data: '', - }; const loadAndZoomParams = { left: bbox[0], bottom: bbox[1], @@ -197,12 +189,11 @@ function loadOsmDataToTasks(project, bbox, newLayer) { top: bbox[3], changeset_comment: project.changesetComment, changeset_source: project.imagery ? project.imagery : '', - new_layer: false, + new_layer: newLayer, + layer_name: 'OSM Data', }; - return callJosmRemoteControl(formatJosmUrl('load_data', emptyOSMLayerParams)).then((result) => { - return callJosmRemoteControl(formatJosmUrl('load_and_zoom', loadAndZoomParams)); - }); + return callJosmRemoteControl(formatJosmUrl('load_and_zoom', loadAndZoomParams)); } export function formatJosmUrl(endpoint, params) {