I am using viewer.render() and viewer.canvas.toDataURL(“image/png”, 1.0) function to capture screenshot of the visible viewer and to generate image url.
Next i am using viewer.scene.camera.computeViewRectangle(ellipsoid) method to get exact rectangle of the viewer.
Later i am adding generated image as SingleTileImageryProvider with rectangle value got from previous step.
For 2d plan it gets added properly but for 3d plan it is not added exact at same position of the globe when screenshot was taken.
I have attached screenshot where you can see overlay between viewer and imagery layer.
Can you please guide me?