code is
//Get the array of entities
var entities = dataSource.entities.entities;
for (var i = 0; i < entities.length; i++) {
var entity = entities[i];
var name = entity.name;
//Make sure it's a polygon and doesn't already have a position.
if (!entity.position && entity.polygon) {
var center = Cesium.BoundingSphere.fromPoints(entity.polygon.positions.getValue()).center;
Cesium.Ellipsoid.WGS84.scaleToGeodeticSurface(center, center);
entity.position = new Cesium.ConstantPositionProperty(center);
}
//Set up the label.
var label = new Cesium.LabelGraphics();
label.text = new Cesium.ConstantProperty(name);
label.font = new Cesium.ConstantProperty('12pt SoberanaSans');
label.fillColor = new Cesium.ConstantProperty(Cesium.Color.WHITE);
label.outlineColor = new Cesium.ConstantProperty(Cesium.Color.BLACK);
label.outlineWidth = new Cesium.ConstantProperty(1);
label.style = new Cesium.ConstantProperty(Cesium.LabelStyle.FILL_AND_OUTLINE)
entity.label = label;
}
result is
how can I resolve this problem.