I'm trying to send a parallel request to a local server(in Nodejs) to get a custom json file(not geojson) like:
app.get('/json/:z/:x/:y', function (req, res) {
return res.status(200).send(JSON.stringify({name:'hello'}));
});
Now I want to request from Cesium whenever any imagery tile is loading by passing z/x/y To achieve that I've created a separate ImageryLayer as given below:
viewer.scene.imageryLayers.addImageryProvider(new
Cesium.UrlTemplateImageryProvider({
url: `http://localhost:2020/json/{z}/{x}/{y}`
}));
However, Above ImageryLayer is sending request to the server But as the server is not returning any image, i'm getting execptions. Also I don't know how to add it's callback to process the response.
So, Is there any best way to send a custom request and process it's response on the basis of current tile request (z/x/y) ? OR Is there any callback on can we create on default ImageryLayer to know what (z/x/y) was requested?