Image overlays can be used to quickly render frequently changing images in a scene view. For example, rendering realtime sensor data, such as weather, where each static image represents a single frame from the radar. Similar to graphics overlays, which contain a collection of graphics based on geometry (points, lines, or polygons), image overlays manage a collection of image frames.
Image overlays and graphics overlays both render above all layers in the scene. Image overlays render below any graphics overlays you've added to the scene view. This ensures that graphics you want to display won't be obscured by your image overlays. For example, you might want to show graphics representing aircraft on top of image overlays showing the sensor data they are collecting.
Since they are designed for quick display, image overlays do not support the rich processing and rendering capabilities of a raster layer, which still provides the best option for workflows that require static image rendering, analysis, and persistence. See Add raster data for more information about working with raster layers.
Image overlays can only be added to a scene view. Map view does not currently support image overlays.
Add an image overlay to a scene view
A scene view manages a collection of image overlays. Each image overlay contains a single image frame that defines an image to display. Georeferenced images (those with a world file) are added at the correct geographic location. Otherwise, you must define a geographic extent for the image frame. If a spatial reference is not defined for the extent, it is assumed to be the same as the scene. If the spatial reference of the extent is different from that of the scene, the image will fail to render.
- If your image doesn't have georeference information, define an extent for the image using an envelope or quadrilateral polygon.
- Create an image frame and pass an image into the constructor. You can specify an image with a URI to a local or online source, supported formats are PNG, JPEG, TIFF, and GeoTIFF. If you need to define the extent explicitly, also pass the envelope or polygon to the constructor.
You can also specify an image by passing an Image to the constructor. These formats are supported for Image: BMP, GIF, JPG, PNG. Animated GIF is not supported, but can be displayed as a static image.
- Add the image frame to an image overlay. The image overlay has properties to control visibility and opacity of the image. Set the opacity less than 1.0 to make the image semi-transparent so data underneath can be seen.
- Add the image overlay to the scene view's image overlay collection. To zoom to the extent of the image, you can set the scene view's viewpoint using the image frame extent.
Like the graphics overlays collection, a scene view image overlays collection can contain multiple overlays. Both types of overlays draw over data in the scene (base maps, operational layers, and so on). Graphics overlays display on top of image overlays in the view.
Radar data for the United States, like that shown in the preceding image, are available for download from the National Weather Service web site.
Animate an image overlay
You can animate the display of image overlays by changing the frame they contain at a specified interval. You might use a timer, for example, to read the next image in a sequence, use it to create a new image frame, and replace the current frame in the image overlay.
Animated GIF format is not supported. If added to an image overlay, it will display as a static image.
- Create a collection of images in the correct sequence. These may be added explicitly, read from a local folder, downloaded from a service, or perhaps read from a shared location that is periodically updated with new data.
- Create a new timer and set it to call a function to change the image at the desired interval.
- For each timer interval, create a new frame with the next image in the sequence and replace the current image frame in the overlay.