I’ve got a use case where I need to show images overlaid directly on terrain, so I’m using a SingleTileImageryProvider for that. However, I’d also like to be able to take that same image and use it elsewhere in the UI. Ideally, I’d like to make sure that the image is only downloaded once, and hand it to both the STIP and my UI. A promise (such as that returned by Cesium.loadImage() ) seems perfect for this. However, SingleTileImageryProvider only accepts a URL, which it ultimately passes to Cesium.loadImage() itself. There’s no way to pass in an existing Image, or promise for an Image, that I can see.
The only workaround I can think of is loading the image myself, paint it to a canvas, convert it to a data URL, then pass that to the STIP. Which, frankly, seems silly.
Are there any other obvious approaches, or is this the only alternative?