How can I show worldCopyJump in leaflet

Viewed 1184

I'm having some problems with the dateline in leaflet. What I would like to do is pretty simple :

Show worldCopyJump on the left and right map at the same time

The idea is to be able to draw a line/points between 179 and -179 and see them duplicated without having the need to jump to the other world

enter image description here

As you can see there is a problem with the polyline (I think I can deal with it). If I have worldCopyJump on true I can switch on another world at the right and have the next part of the polyline.

I think that Marine traffic is doing it or there are duplicating markers.

And OpenLayer seems to have the perfect option: open layers by using wrapx

Any idea on how to do it ? My current solution is not the best since I'm checking if it cross the dateline and then add 360 to the longitude.

0 Answers
Related