I am developing an application which needs to show a polyline which occassionally crosses the dateline. Problem is longitude bounds are -180 and +180. I have fenagled things to determine the index of the dateline in the array of coordinates. After crossing the index I just add +360 or -360 to continue the line as-is. This works and it shows the polyline. There is one catch. The user has to move the map left or right over the dateline. When that happens the polyline appears. This is obviously not a good solution.
Has anybody figured out how to display a polyline over dateline properly in leaflet from the get-go? Meaning without the need to move the map left or right to cross the dateline to make the polyline appear.