I want to display the drawing tools once the Map is cleared. For clearing the root I used these lines
ui.root.clear();
ui.root.add(ui.Map());
To display the drawing tools again I use this line of code
ui.Map.DrawingTools({
shown: true
})
But drawing tools are not shown.
How do I achieve this?
Best Answer
ui.root.clear destroys the main ui.Map. You've created another Map (not the one that the global variable Map points to), so you need to keep it and reference the new one. Getting the drawingTools object from the map turn it on.