$.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();
}
}
});