3mapslab / Leaflet.streetlabels

Display the street labels following polylines for Leaflet
ISC License
72 stars 13 forks source link

Streetlabels mixes the offset done by Polyline Offset #15

Closed dave-driesmans closed 2 years ago

dave-driesmans commented 2 years ago

Describe the bug We have a map where we want to display direction flows in the street. We use Polyline offset for that and that works fine. As soon as we add the streetLabels Renderer it mixes the offset. Negative becomes positive for some.

Screenshots Left with StreetLabels, right without Screenshot 2022-03-30 at 16 18 59

Can anyone point me to a possible solution? Or where i should look in the code?

dave-driesmans commented 2 years ago

Ok, it's due to this

if (this._getBearing(startCoords, stopCoords) < 0) {
       layer = this._getLineStringReverse(layer);
}

When i leave it the lines aren't swapped. The text is up side down for some polylines but that's ok for the moment.