Closed pantierra closed 2 years ago
Is there documentation on how I can setup a tasking manager with RapiD? Or migrate an existing tasking-manager?
@jayenashar Do you want to make RapiD your main editor or just give users the option to use it?
if there's no licensing issues, the main editor.
@jayenashar we are going to integrate RapiD inside TM on the next few months, for now I think you could:
replace '?editor=ID'
by 'https://mapwith.ai/rapid'
on https://github.com/hotosm/tasking-manager/blob/fix/env-var-instructions/frontend/src/utils/openEditor.js#L18
and replace iD by RapiD on that line https://github.com/hotosm/tasking-manager/blob/develop/frontend/src/utils/editorsList.js#L6
Let me know if that solution works.
did you mean to paste a link to the same line in two separate branches?
i was able to do the first replacement, but now the TM goes to a URL like https://tasks.smartcitiestransport.com/projects/1/map/https://mapwith.ai/rapid?#map=16/-37.08585785263673/144.1571044921875&comment=%23oceania-tm-project-1%20%23buildings&gpx=https%3A%2F%2Ftasks.smartcitiestransport.com%2Fapi%2Fv2%2Fprojects%2F1%2Ftasks%2Fqueries%2Fgpx%2F%3Ftasks%3D835&presets=building
@jayenashar sorry, the second link I pasted was wrong. I fixed it on my previous comment.
Actually, replace that line: https://github.com/hotosm/tasking-manager/blob/fix/env-var-instructions/frontend/src/utils/openEditor.js#L18
by:
const rapidUrl = 'https://mapwith.ai/rapid';
windowObjectReference.location.href = getIdUrl(project, center, zoom, selectedTasks, rapidUrl);
return '?editor=CUSTOM';
@jayenashar you'll also need to move that if statement to after the following one.
here's my diff:
diff --git a/frontend/src/utils/openEditor.js b/frontend/src/utils/openEditor.js
index 761ff3b2..6844b8e6 100644
--- a/frontend/src/utils/openEditor.js
+++ b/frontend/src/utils/openEditor.js
@@ -15,7 +15,12 @@ export function openEditor(
}
const { center, zoom } = getCentroidAndZoomFromSelectedTasks(tasks, selectedTasks, windowSize);
if (editor === 'ID') {
- return getIdUrl(project, center, zoom, selectedTasks, '?editor=ID');
+ if (windowObjectReference == null || windowObjectReference.closed) {
+ windowObjectReference = window.open('', `iD-${project}-${selectedTasks}`);
+ }
+ const rapidUrl = 'https://mapwith.ai/rapid';
+ windowObjectReference.location.href = getIdUrl(project, center, zoom, selectedTasks, rapidUrl);
+ return '?editor=CUSTOM';
}
if (windowObjectReference == null || windowObjectReference.closed) {
windowObjectReference = window.open('', `iD-${project}-${selectedTasks}`);
it opens rapid but doesn't zoom to the task. i was also a little confused by windowObjectReference == null
since windowObjectReference
is undefined
not null
What's the URL it's generating?
If you want your users to use only Rapid, another solution would be to set a custom editor on all projects and activate only the custom editor on all projects.
looks like it opened this:
which redirected to:
and then:
and i think finally stopped redirected on:
Hello everyone, integration of RapiD inside TM is complete now. Integrated Rapid can be enabled while creating/editing a project on the settings tab.
So far:
Let's think about making AI-assisted mapping a standard feature of Tasking Manager.