Cant hide leaflet routing machine route instruction

84 views Asked by At

I would like to hide or display this routing machine instruction in more pleasing way, but once I turn off the auto-route, waypoints route drawing is also turning off....I have also tried the show:false and other css to hide it but still dont works for me.

enter image description here

1

There are 1 answers

0
Milos Stojanovic On

This worked for me:

First get routeControl

this.routeControl = L.Routing.control({})

After that, modify routingControlParent

const routingControlContainer = this.routeControl.getContainer()
const controlContainerParent = routingControlContainer.parentNode
controlContainerParent.removeChild(routingControlContainer)

I guess, what you are doing is removing routing information html element.