1. A concise explanation of the problem you’re experiencing.
We are drawing polygons, and, among 1500+ polygons we draw there are particular two which make Cesium crash. Any one of these two works fine, but two drawn together appears to be deadly for Cesium. Need help figuring out what makes these two polygons so special to cause such an effect so we could get it under control.
Following code illustrates the matter. It can be copied to Sandcastle and run to see the crash.
Suggestions?
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
var viewer = new Cesium.Viewer(‘cesiumContainer’);
var polys =
[
“172.634577109946,-43.5297673648253,0 172.634804217336,-43.529495739866,0 172.634806485168,-43.5294930288697,0 172.634861434736,-43.5294273070786,0 172.63494253963,-43.5293130740366,0 172.635009486553,-43.5292016873973,0 172.635114926283,-43.5290395485974,0 172.635114417915,-43.5288578214237,0 172.635301832678,-43.5288575599225,0 172.635408591283,-43.5288574118932,0 172.635599024564,-43.5288571506268,0 172.635607810592,-43.5288571384131,0 172.63566038171,-43.5288570665048,0 172.635662432337,-43.5288570636994,0 172.635662432432,-43.5288570624672,0 172.636245599313,-43.5288562513054,0 172.636260035845,-43.5288562340014,0 172.636496957722,-43.528855901815,0 172.636497169339,-43.5289387006143,0 172.636497389941,-43.5290241274363,0 172.636497536498,-43.5290825429202,0 172.636498133855,-43.5293102642739,0 172.636498648162,-43.5295082916736,0 172.636498648325,-43.5295103618935,0 172.636498648185,-43.5295124230153,0 172.636498799238,-43.5295701455729,0 172.636498801941,-43.5295717297606,0 172.636499266063,-43.5297491722762,0 172.636478143775,-43.5297645959975,0 172.636157010028,-43.5297650671343,0 172.635513406837,-43.5297660022342,0 172.634730804991,-43.5297671412286,0 172.634577109946,-43.5297673648253,0”,
“172.632717748155,-43.5252174117892,0 172.632718750085,-43.5252174149852,0 172.632718749997,-43.5252174111734,0 172.632717748064,-43.5252174079776,0 172.632717748155,-43.5252174117892,0”
];
for (var i in polys)
{
var poly = polys[i];
var degarray = ;
var pts = poly.split(’ ');
for (var i in pts)
{
var pt = pts[i].trim();
var coords = pt.split(’,’);
if (coords.length>1)
{
var lng = parseFloat(coords[0]);
var lat = parseFloat(coords[1]);
degarray.push(lng);
degarray.push(lat);
}
}
viewer.entities.add
({
name : name,
polygon :
{
hierarchy : Cesium.Cartesian3.fromDegreesArray(degarray),
heightReference : Cesium.HeightReference.CLAMP_TO_GROUND,
clampToGround : true
}
});
}
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
The answer to this should be obvious.
4. The Cesium version you’re using, your operating system and browser.
Cesium 1.50. Chrome. Tried on both Windows and Lynux - both crash.