1. A concise explanation of the problem you're experiencing.
I want to place canvas image content on rectangle entity, however the canvas image is not aligning with exact cartographic positions on this entity, hence data prediction cannot be summarized, with cartographic positions. So the intent is to pass rectangle width and height in pixel numbers, to limit the image construction between these bounds on the separate canvas.
So to leverage that, I have converted cartographic points to screen points, and now I want to calculate the width and height and provide it to canvas for creation of image between these bounds.
Algo Sample
function getDimensions(screen1, screen2) {
var json = {};
var camera = viewer.scene.camera;
var scaleFactor = <some value calculated>;
var diffX = Math.abs(screen2.x - screen1.x);
var diffY = Math.abs(screen2.y - screen1.y);
json.height = diffX*scaleFactor;
json.width = diffX*scaleFactor;
return json;
}
2. A minimal code example. If you've found a bug, this helps us reproduce and repair it.
3. Context. Why do you need to do this? We might know a better way to accomplish your goal.
4. The Cesium version you're using, your operating system and browser.