Invali Array Lenght

1. A concise explanation of the problem you're experiencing.

I have Json data,at the time of loading data there is rendering error.I tried some solutions but still its not solved.

Error:
An error occurred while rendering. Rendering has stopped.
RangeError: Invalid array length
RangeError: Invalid array length
    at Me (http://localhost/cesium/Build/Cesium/Cesium.js:552:18985)
    at Ne (http://localhost/cesium/Build/Cesium/Cesium.js:552:21706)
    at Ke (http://localhost/cesium/Build/Cesium/Cesium.js:553:84)
    at Qe (http://localhost/cesium/Build/Cesium/Cesium.js:552:30061)
    at ot (http://localhost/cesium/Build/Cesium/Cesium.js:553:4958)
    at Ee.render (http://localhost/cesium/Build/Cesium/Cesium.js:553:12911)
    at A.render (http://localhost/cesium/Build/Cesium/Cesium.js:566:8588)
    at t (http://localhost/cesium/Build/Cesium/Cesium.js:565:23673)

Code:I tried these little bit code.
var data= Cesium.GeoJsonDataSource.load('geoserver-GetFeature.json');
    console.log(data);
    var entities;
data.then(function(dataSource){
                viewer.dataSources.add(data);
                viewer.zoomTo(data);
               entities = dataSource.entities.values;
                changeHeightStyle();
});
function changeHeightStyle(){
                var entity;
                var extrudedHeight;

                for(var i=0; i<entities.length;i++){

                    entity = entities[i];
                    entity.polygon.outline = false;
                    extrudedHeight = entity.properties.GRIDCODE *1000;

                    entity.polygon.extrudedHeight = extrudedHeight;
                     var gridcodeh = entity.properties.GRIDCODE
                    entity.polygon.material = getColorHeight(gridcodeh);

                }
                    colorlegend1.style.display = "block";
                    colorlegend2.style.display = "none";
}

I have Cesium 1.39,i tried with some other cesium versions also.Thanks

Hi there,

In this line I see you are loading just a filename. This should be a url. You’ll need to serve the data using a web server of some kind.

var data = Cesium.GeoJsonDataSource.load(‘geoserver-GetFeature.json’);

Also take a look at how Cesium uses Property objects.

Hope that helps, thanks,

Gabby

Thanks Gabby,i solved my problem,their is case sensitive letters problem. GRIDCODE----->gridcode
var gridcodeh = entity.properties.GRIDCODE.

Awesome, glad it was a simple fix. Thanks for the update!