Rendering has stopped.(polyline from geojson)

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

I tried to draw the entity from geojson , linestring but came up with the

following error. The feature count is approximate 7000.

-----------Error Message--------------------

An error occurred while rendering. Rendering has stopped.

TypeError: Failed to execute ‘shaderSource’ on ‘WebGLRenderingContext’: parameter 1 is not of type ‘WebGLShader’.

TypeError: Failed to execute ‘shaderSource’ on ‘WebGLRenderingContext’: parameter 1 is not of type ‘WebGLShader’.

at f (http://192.168.1.111/c1t1/Build/Cesium/Cesium.js:497:12800)

at y (http://192.168.1.111/c1t1/Build/Cesium/Cesium.js:497:15937)

at d._bind (http://192.168.1.111/c1t1/Build/Cesium/Cesium.js:497:16952)

at V (http://192.168.1.111/c1t1/Build/Cesium/Cesium.js:522:21796)

at k.draw (http://192.168.1.111/c1t1/Build/Cesium/Cesium.js:522:25431)

at n.execute (http://192.168.1.111/c1t1/Build/Cesium/Cesium.js:496:17756)

at d.executeCopyColor (http://192.168.1.111/c1t1/Build/Cesium/Cesium.js:536:2495)

at tt (http://192.168.1.111/c1t1/Build/Cesium/Cesium.js:541:17467)

at it (http://192.168.1.111/c1t1/Build/Cesium/Cesium.js:541:18658)

at we.render (http://192.168.1.111/c1t1/Build/Cesium/Cesium.js:541:26600)

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

var promise = Cesium.GeoJsonDataSource.load(’…/Specs/Data/KML/tn1_road_84.geojson’);

promise.then(function(dataSource) {

viewer.dataSources.add(dataSource,

{

camera: viewer.scene.camera,

canvas: viewer.scene.canvas,

clampToGround: false

}

);

var entities = dataSource.entities.values;

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

var entity = entities[i];

entity.polyline.material = Cesium.Color.WHITE;

entity.polyline.width = 10;

}

});

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

I would like to test the performance in 3D with pipeline data, maybe more than 7k or more.

4. The Cesium version you’re using, your operating system and browser.

Cesium: 1.41

OS: Win7 x64

**Browser: Chrome, **Version 63.0.3239.132 (Official Build) (64-bit)

Hi there,

I don’t have the data, so I can’t replicate directly. If you could post it, that might help. However. DataSourceCollection.add doesn’t take an options parameter, instead make sure you are passing it to GeoJsonDataSource.load. Also check if the entity.polyline is defined before you modify it, just in case it is not a polyline entity.

Thanks,

Gabby

Hi Gabby,

I am also having problems loading a geojson data set in version 1.42. Our data has 2800 features, and we have been able to load the data in an app using version 1.23.

code:

var promise = Cesium.GeoJsonDataSource.load(zones, {
    stroke: Cesium.Color.BLACK,
    fill: new Cesium.Color(0.01,0.01,0.01,0.01)
});
promise.then((dataSource) => {
    this.viewer.dataSources.add(dataSource);
}).otherwise(function(error){
    //Display any errrors encountered while loading.
    window.alert(error);
});


Our data is open to the public, so it’s attached to this post. Is this file too much data to load without using 3D tiles?

Thanks,

Justin

Oops forgot to attach the data:

zonesGeo.json (1.53 MB)

Your data works for me. A couple of changes to your Sandcastle example though.

Scott

var viewer = new Cesium.Viewer(‘cesiumContainer’);

var promise = Cesium.GeoJsonDataSource.load(’…/…/…/Specs/Data/GeoJSON/zonesGeo.json’, {

stroke: Cesium.Color.BLACK,

fill: Cesium.Color.GOLD

});

promise.then(function(dataSource) {

viewer.dataSources.add(dataSource);

viewer.zoomTo(dataSource.entities);

});

``

Thanks Scott!

Justin, if you are running into issue rendering geoJson directly, take a look at getting the data converted to 3D Tiles, as it should improve performance.

Thanks,

Gabby