Entity Polyline vs Polygon error

I’ve found an issue where polylines and polygons with the same set of points don’t render in the same place. The problem seems to be with the polygon since the polylines points line up with the mouse downs. There are some special circumstances with this issue. This appears to only happen over terrain and the camera must be zoomed in a fair bit.

The demo isn’t the best but does show the problem. Move the camera to a location over some mountains and then zoom in. Click the drawing check box and then click five or six locations on the map. The polygon will render inside of the polyline. In the example the polygon’s hierarchy doesn’t appear to be updating properly, but the image shows the issue.

Scott

Terrain.html (10.2 KB)

Hi Scott,

This is happening because you’re setting the polygon height: 0. This makes the polygon draw at height 0 on the WGS84 ellipsoid. If you leave height: undefined it should conform to terrain.

Best,

Hannah

I removed the height, and I’m still seeing the issue. Is there something else that I’m setting that is causing the problem?

_area = viewer.entities.add( {

“name”: “tempArea”,

“polygon”: {

“extrudedHeight”: 0,

“hierarchy”: _points,

“outline” : true,

“outlineColor” : Cesium.Color.GREEN,

“outlineWidth” : 3,

“material”: Cesium.Color.GREEN,

“closeTop”: false

}

} );

You need to remove extrudedHeight as well

-Hannah