var two = Cesium.GeoJsonDataSource.load('../../../static/country_one.json');
two.then(function(dataSource) {
console.log(dataSource)
viewer.dataSources.add(dataSource);
var entities = dataSource.entities.values;
console.log(entities)
let color = new Cesium.Color(6/255.0,37/255.0,75/255.0,255/255.0);
let outlineColor = new Cesium.Color(12/255.0,71/255.0,143/255.0,255/255.0);
for (let i = 0; i < entities.length; i++) {
var entity = entities[i];
entity.polygon.material = color;
entity.polygon.outline = true;
entity.polygon.outlineColor = outlineColor;
entity.polygon.outlineWidth = 2;
entity.polygon.height = 0;
entity.polygon.extrudedHeight = 0;
}
});
怎么解决,目前找了很多方式,都没解决。
@admin [#1楼](#comment1) 1.不用vue情况说明:加载大量geojson不会崩溃。
2.用vue情况说明:加载少量geojson不会崩溃。绘制性能低
3.举个例子:6W+立方体相对比较:vue在500毫秒左右,js下50毫秒。 相差10倍