If you want to remove the map from the web page while the application is running, call the destroy() method on the map. This method cleans up the DOM structure and event hooks.