Hello,
I have drawn two polylines as follows.
In 2D view, one is a straight line, but the other, crossing the antimeridian, is not. Why does this happen? And how can I make it straight?
Hello,
I have drawn two polylines as follows.
In 2D view, one is a straight line, but the other, crossing the antimeridian, is not. Why does this happen? And how can I make it straight?
Hi @mika, welcome to the community!
Thanks for the Sandcastle! It makes it very easy to understand your question.
I agree this is unexpected behavior. The code has to interpolate a point where the line crosses the antimeridian. Apparently it places this point assuming the line is a geodesic curve, even though you have specified "arcType":"NONE"
. You can tell the interpolation is geodesic by switching to 3D view: the line appears straight in that view.
If the 2D view is important for your use case, one workaround would be to compute the correct point on the antimeridian, and insert that point into the positions array. Here is a quick Sandcastle showing that approach.