Announcement: All noncommercial projects registered to use Earth Engine before
April 15, 2025 must
verify noncommercial eligibility to maintain Earth Engine access.
ui.root.clear
Stay organized with collections
Save and categorize content based on your preferences.
Clears the root panel.
Usage | Returns | ui.root.clear() | |
No arguments.
Examples
Code Editor (JavaScript)
// Replace the default UI widgets with a few custom widgets.
ui.root.clear();
ui.root.add(ui.Label('This is a custom user interface.'));
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[[["\u003cp\u003eClears all existing widgets and elements from the root panel of the user interface.\u003c/p\u003e\n"],["\u003cp\u003eAllows for customization of the UI by adding new widgets after clearing the root panel, as demonstrated in the example using \u003ccode\u003eui.Label\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# ui.root.clear\n\n\u003cbr /\u003e\n\nClears the root panel.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-------------------|---------|\n| `ui.root.clear()` | |\n\n**No arguments.**\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Replace the default UI widgets with a few custom widgets.\nui.root.clear();\nui.root.add(ui.Label('This is a custom user interface.'));\n```"]]