perliedman / leaflet-routing-machine

Control for routing in Leaflet
https://www.liedman.net/leaflet-routing-machine/
Other
1.06k stars 347 forks source link

Changing route color when click on marker #654

Closed BenLaKnet closed 2 years ago

BenLaKnet commented 2 years ago

Hi,

I want to change route color when I click on Start or End marker, how is it possible ? https://www.lamaraudiere.com/d4ua/cartographie.php

curtisy1 commented 2 years ago

You should be able to use the routeLine option on L.Routing.Control to customize the line appearance depending on which line is currently selected. Technically, clicking a marker should trigger a route event in your example since it displays the itinerary and would also redraw the routes

BenLaKnet commented 2 years ago

Hi @curtisy1 ,

I found this link too : https://stackoverflow.com/questions/53963285/routing-control-name-and-add-custom-markers, and that helps me to change route line color.

Many thanks