My apologies Gabby, that sandbox is incomplete. I adapted it from my previous question but apparently I pasted the wrong link. Below is the correct one.
I don’t believe this is a bug with polylines, I believe this distortion is due to the map projection, the Web Mercator projection, which distorts parts of the globe to get a nice flat map. Let me know if that doesn’t look the cause of the problem you’re having.
I thought about that as well, but commenting out the WebMercatorProjection (line 16) only made the distortion less dramatic. Try it and see if you get the same result
You can see what’s going on if you toggle back and forth between the 2D and 3D scene modes. If you look at the globe in 3D, you can see that the line is connecting via a great arc (https://en.wikipedia.org/wiki/Great_circle) which connects two point via the shortest distance on the globe rather than keep latitude constant. When this gets projected in 2D, it appears “warped” because it’s not following a constant latitude. What you need is a Rhumb line(https://en.wikipedia.org/wiki/Rhumb_line) which I can’t find an option to use.
The lines I'm drawing are followSurface:false, which disables the great-arc behavior and directly connects two coordinates on the ellipsoid. I took your example and expanded it a bit with some more test cases and I think it's a better example of the behavior that confuses me. What you need to do after opening the Sandcastle is to switch to Columbus mode and then pan the camera down to 'look under the table' so to speak. You should see halves of some of the lines 'going into the table', which is the source of the distortion
When the line is from -80,20 to 80,20, it displays the distortion along the prime meridian, just as a line of any length across the antimeridian displays the behavior. However, if you have a line of -40,20 to 40,20, the behavior is as expected, and you get a flat line along the surface.
I believe what you are seeing is two points being connected by a straight line that goes through the earth. You can see what I’m talking about if you manipulate the scene such that you are looking along the line that has one point in CONUS, first by rotating up and then slightly horizontally.
I’ve also seen this issue and was meaning to post about it. By “this issue”, I mean that straight (i.e. followSurface:false) lines through the Earth show strangely in 2D and Columbus views. That is, in 2D mode the line looks like two sides of a triangle (/) connecting the sites, though sometimes the top is obscured. In Columbus view, you see the same /\ shape but it is intact and shown below the surface.
I think this is a different issue than the the “rhumb lines” enhancement. Could a separate issue be created for it?
I believe this exact situation you describe would be fixed by enabling rhumb lines. The line would would appear straight in both 2D and Columbus Views.
Yes that's right Scott, what is strange to me is that some lines exhibit this behavior while others do not. For example, a 160 degree line from lon -170 to lon -10 will display properly in 2D and Columbus. However, a line from -80 to 80 will not.