Polygon outlines

I need to be able to outline a 2D polygon within Cesium. I've been through the Sandcastle and have seen the examples showing how to outline a polygon using a PolygonOutlineGeometry. The issue I'm having though is that, we primarily use Cesium in 2D mode and the polygon that I am using wraps from one side of the view to the other. Using an outline geometry will connect one side to the other, creating a straight line all the way across the globe which, isn't the desired effect. I attempted to take the same positions used to create the polygon to create a polyline to outline the polygon. That gets me closed to the desired effect but it's not really high fidelity data and when it creates the polygon, the polygon seems to have a smoothing effect at the vertex positions. A polyline doesn't have that so the polyline doesn't accurately follow the edge of the polygon.

Aside from generating higher fidelity data, is there a better method for outlining the polygon the way I'm describing? I don't see a way to make the polygon outline not connect the way I'm referring to.


This is most certainly a bug in either PolylineOutlineGeometry or the PolylinePipeline when breaking points up to render across the international date line. Can you share some sample code, or the list of points you are using that cause the problem?

I'm using a polyline and I don't have any problems on the 2D map:

var polyline = new Cesium.Polyline();
var radiusInMeters = 300000;
var pos = Cesium.Shapes.computeCircleBoundary(

  ellipsoid, ellipsoid.cartographicToCartesian(
    Cesium.Cartographic.fromDegrees(179.0, 30.0, 0.0)), 3700000.0));