1. A concise explanation of the problem you're experiencing.
In 2d mode, attempting to use a callback to dynamically update a polygon in the Middle East and do the same in Florida. It works in florida but not in the middle east. I suspect altitude to be an issue even though its a 2d rendering. After playing with some a snippets of the data used to draw the polygon in both locations, I stumbled across this problem and suspect it may be the reason the callback only periodically shows the polygonin the middle east(for a couple seconds every 2 or three minutes of updating) but always in Florida.
2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
MIDDLE EAST (AT ALTITUDE) -
1)DOES NOT DRAW
var viewer = new Cesium.Viewer('cesiumContainer', { sceneMode: Cesium.SceneMode.SCENE2D});
var redPolygon = viewer.entities.add({
name : 'Red polygon on surface',
polygon : {
hierarchy : Cesium.Cartesian3.fromDegreesArrayHeights([69.14103508068031, 34.4370317376699, 10000, 69.13856255397852, 34.4373630031087, 10000, 69.13882892805812, 34.43860268353382, 10000, 69.1413492695559, 34.438261174482825, 10000]),
material : Cesium.Color.RED
}
});
viewer.zoomTo(viewer.entities);
2)DOES DRAW
var viewer = new Cesium.Viewer('cesiumContainer');
var redPolygon = viewer.entities.add({
name : 'Red polygon on surface',
polygon : {
hierarchy : Cesium.Cartesian3.fromDegreesArrayHeights([69.14103508068031, 34.4370317376699, 10000, 69.13856255397852, 34.4373630031087, 10000, 69.13882892805812, 34.43860268353382, 10000, 69.1413492695559, 34.438261174482825, 10000]),
material : Cesium.Color.RED
}
});
viewer.zoomTo(viewer.entities);
FLORIDA (AT SEA LEVEL) - BOTH CORRECTLY DRAW THE POLYGON
1)DOES DRAW
var viewer = new Cesium.Viewer('cesiumContainer', { sceneMode: Cesium.SceneMode.SCENE2D});
var redPolygon = viewer.entities.add({
name : 'Red polygon on surface',
polygon : {
hierarchy : Cesium.Cartesian3.fromDegreesArrayHeights([-81.34480044854797, 27.662419817998558, 0, -81.34445210902024, 27.66424689298772, 0, -81.34191810875059, 27.663326524980686, 0, -81.3416722220044, 27.66022049670308, 0]),
material : Cesium.Color.RED
}
});
viewer.zoomTo(viewer.entities);
2)DOES DRAW
var viewer = new Cesium.Viewer('cesiumContainer');
var redPolygon = viewer.entities.add({
name : 'Red polygon on surface',
polygon : {
hierarchy : Cesium.Cartesian3.fromDegreesArrayHeights([-81.34480044854797, 27.662419817998558, 0, -81.34445210902024, 27.66424689298772, 0, -81.34191810875059, 27.663326524980686, 0, -81.3416722220044, 27.66022049670308, 0]),
material : Cesium.Color.RED
}
});
viewer.zoomTo(viewer.entities);
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
Use callback to dynamically update polgyons in both florida and middle east at altitude. Polygons are correctly updated in florida but not the middle east at high altitude.
4. The Cesium version you're using, your operating system and browser.
Cesium 1.5. 64bit i9 2.9ghz. Chrome.