Reputation: 3265
I have two points I would like to connect via line string:
var a = ol.proj.fromLonLat([-159.6597257, 21.995953]);
var b = ol.proj.fromLonLat([166.644261, 19.279499]);
Is there a way to draw this line in a way it would not cross the globe.
Fiddle: https://jsfiddle.net/82dgrwny/
Upvotes: 0
Views: 411
Reputation: 17962
OpenLayers understands "wrapped" coorrdinates. Use either
var a = ol.proj.fromLonLat([360 - 159.6597257, 21.995953]);
or
var b = ol.proj.fromLonLat([166.644261 - 360, 19.279499]);
Upvotes: 3