perliedman / leaflet-routing-machine

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

Line drawing problems. lineOptions almost doesn't work. #565

Closed chunkey711 closed 4 years ago

chunkey711 commented 4 years ago

Hi there!

I've been tryin to implement drawing paths with your lib. But faced with some problems in line styling and etc.

 L.Routing.control({
        router: L.Routing.mapbox('mytoken', { profile: 'mapbox/driving' }),
        waypoints: [
          L.latLng(25.0788646, 55.1574994),
          L.latLng(25.086784, 55.147522)
        ],
        routeWhileDragging: false,
        draggableWaypoints: false,
        addWaypoints: false,
        lineOptions: {
          styles: [{ color: 'black',
            opacity: 1,
            weight: 100000,
            fill: false,
            fillOpacity: 0
          }]
        }
  }).addTo(this.map);

Path is being drawn, but also i got filled area between points, and it looks like this. Also, color, and weight options in "lineOptions.style" is now working as you can see, the weight options value = 100000. The only one option is working correctly is "opacity"

image

chunkey711 commented 4 years ago

Problem is solved. I found css overrides in legacy.