[GIS] Remove routing-container of leaflet-routing

leafletrouting

How to remove the whole container (see picture below) of leaflet-routing that includes distance and travel time via a button in my index.html?

unwanted container

If i remove line 3508 of leaflet-routing-machine.js: return this._container; the container is not visible. But this way is not an option.

Best Answer

Adding show: false and collapsible: false to the control didn't seem to do the trick. But you can manipulate the container's CSS with Javascript this way:

control._container.style.display = "None";

To show it again later you can reverse this by doing:

control._container.style.display = "Block";