Closed rishav-karanjit closed 1 year ago
I have done a lot of projects using leaflets. If it's fine, I want to solve this issue by myself. Can I be assigned to this issue?
Thank you for the detailed issue description with example and being willing to help! It's greatly appreciated.
First off, I agree with everything you said. The option is a little confusing at the moment and should probably be changed to an implementation that is a little more intuitive.
That being said, I think this needs some further discussion on how to approach this. Off the top of my head, these questions would need to be sorted out first:
I think the reason behind the current way of doing things is the third point. The polylines are added above each other, so you have the option to create some kind of shadow together with your polyline. However, I think the defaults can be done with just a single option and polyline, so it should be fine to change this.
I assigned the issue to you. As mentioned, please use the typescript branch as your working base, so I can get this merged into the next release.
Thank you!
For reference, here's a comparison of using combined styles for one route, compared to just one style (left is the current default, right is possible new styles). I think this is not too big of a change though, so it should be fine. Plus the behavior can be overridden as well
I think the current approach is fine. If number of styles and number alternative routes does not match, the option would be more less intuitive.
According to the documentation, L.Routing.Control class have a option altLineOptions. For some reason, altLineOptions is a list of styles. I expected each alternative route to having a separate color from the list in altLineOptions. But, all alternative route have the style that is in the last item of the list.
Example:
I have given the following in altLineOptions:
But all alt line option has the same style as the last item in the list. I have used graphhopper routing backend.![image](https://user-images.githubusercontent.com/47602642/222191184-37c713f7-5a80-4899-9ac9-e57da99d25e9.png)