Invali Array Lenght

51 views
Skip to first unread message

er.seem...@gmail.com

unread,
Nov 24, 2017, 4:22:56 AM11/24/17
to cesium-dev
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


Gabby Getz

unread,
Nov 27, 2017, 4:50:53 PM11/27/17
to cesium-dev
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







--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Seema Barate

unread,
Nov 27, 2017, 10:48:30 PM11/27/17
to cesiu...@googlegroups.com
Thanks Gabby,i solved my problem,their is case sensitive letters problem. GRIDCODE----->gridcode
  var gridcodeh = entity.properties.GRIDCODE.
                                                             
                                                             

--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/vsBYxjz4UNQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+unsubscribe@googlegroups.com.

Gabby Getz

unread,
Nov 29, 2017, 5:07:25 PM11/29/17
to cesium-dev
Awesome, glad it was a simple fix. Thanks for the update!
Reply all
Reply to author
Forward
0 new messages