1. A concise explanation of the problem you’re experiencing.
Hi. I am tasked with developing the project where i have to show the geojsons when a person zooms in to a specific section. the system will match the center of the screen and see if it is present within the pre defined sections by using Spatial GIS function of ST_Within() of MYSQL and will fetch a prebuilt geojson file to be rendered. This whole process is taking longer than expected and there is a delay of 6-10 secs for the geojsons to be rendered on the cesiumjs is there a way to speed up this process. This is a dummy website in development and the data is being fetched from a live server
P.S I cant use the cesiumjs paid version because of the client restriction.
2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.
$.ajax({
url: ‘<?php echo site_url("Geojson/fetchgeojsons"); ?>’,
type: ‘post’,
data : {
data0 : y,
data1 : x,
data2 : z,
},
dataType: ‘json’,
success: function(data)
{
if(geojsonsnames.includes(data.block_id)==false)
{
console.time();
geojsonsnames.push(data.block_id);//an array to stop refetching the same (block/section) repeatedly
length=length+1;slength=slength+1;
geojsons[length]=Cesium.GeoJsonDataSource.load(“<?php echo base_url();?>”+data.block_geojson, {
stroke: Cesium.Color.HOTPINK,
fill: Cesium.Color.PINK,
strokeWidth: 3,
markerSymbol: ‘?’
});
geojsons[length].then(function(dataSource0)
{
viewer.dataSources.add(dataSource0);
slength[slength] = dataSource0;
//Get the array of entities
vals = dataSource0.entities.values;
// colordip(vals);
}).otherwise(function(error){
//Display any errrors encountered while loading.
window.alert(error);
});
console.timeLog();
}
}
});
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
The result of the console.timeLog is around 15.315185546875ms but the rendering time is greater than 6-10 secs. Here is the picture of the rendered geojson. Is there a way we can increase the rendering speed. Or even start the rendering of the polygon as soon as the geojson starts arriving at host computer.
4. The Cesium version you’re using, your operating system and browser.
Cesium 1.5, Windows 10, Chrome and Firefox
Block_A_(OS-I).geojson (3.07 MB)