Torres Clarizza DL
Torres Clarizza DL

Reputation: 31

Cant hide leaflet routing machine route instruction

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

Upvotes: 0

Views: 508

Answers (1)

Milos Stojanovic
Milos Stojanovic

Reputation: 557

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.

Upvotes: 0

Related Questions