In this topic
- About Non-dynamic layers
- How non-dynamic layers are rendered
- Caching of non-dynamic layers
- Best Practices
Layers that don’t implement the interface IDynamicLayer are regarded as non-dynamic layers. The two essential concepts to understand the rendering of non-dynamic layers in dynamic mode are
- The tiling schema
- Loader Thread
The dynamic display uses a tile schema to render the non-dynamic layers in a dynamic map. The figure below, illustrates a dynamic map rendering its non-dynamic layer based on its tiling schema.
The tiles schema for non-dynamic layers is based on a discrete set of levels of details (LOD), meaning that tiles pertaining to a certain LOD corresponds to a certain map scale. At a given map scale, the dynamic display will determine the most suitable LOD of tiles and use these tiles in order to render the dynamic layers.
Once a non-dynamic layer gets created by the dynamic display, according to the map’s projection horizon, the first LOD is being computed. The first LOD is the bounding square that bounds the projection horizon. From there, on each consecutive LOD, each tile is divided into four quarters. The information about each LOD is stored by the dynamic display and is used to determine the nearest LOD to use along with each map scale.
Calculating the first LOD
Each non-dynamic layer has a background thread which is in charge of handling requests for tiles. As the thread gets created, the given layer is being handed to it. As the map switches into dynamic mode, the dynamic display sets requests for tiles according to the given map extent and map scale. The loader thread processes these requests and either fetches the tiles from cache or generates the tiles on the spot, in the case where these tiles do not already exists.
As the map switches into dynamic mode, the dynamic display, according to the given map scale, determines the best LOD to be used and sets requests for tiles onto the loader thread. At some point, these requests will be processed and tiles will be returned back to the map. The dynamic display then scale these tiles further in order to match the map’s scale and render them as requested.
Due to the existence of the background loader thread, the drawing model of the non-dynamic layers is asynchronous, meaning that once a request for a tile is set, there is no way to know when the actual tile is ready to be rendered. For that reason, the dynamic display uses several techniques in order to give the user maximum responsiveness as well as enhanced drawing user experience. These include the use of coarse grained textures which are used as the requested tiles are being processed. For more information on controlling the drawing characteristics of non-dynamic layers refer article….
By default, the dynamic display creates a separate cache for each individual layer in the map based on its tiling schema and LOD. At runtime, each cache is translated into textures by the background thread and the layer is rendered as a sequence of adjacent textures in the form of seamless tiles. The cache structure is similar to the ArcGIS Server cache structure.
In general, during navigation, if the cache is not available for that area, the background thread will try to create it, which leads to CPU usage. However, layer files and map files persist cache information when saved while in dynamic mode. Therefore, for better performance and avoid CPU usage on subsequent map navigations, enable the dynamic map first, and save the layers as layer files or save the maps as map files. This would allow the Dynamic Display framework to reuse the existing cache information on subsequent map navigations.
The cache information is not based on one map scale, but a range of map scales. Once an area in the map is accessed (zooming and roaming), the cache information is generated for that area (on a background thread). When they are saved as layer files or map files, and if you revisit the same area, dynamic display identifies where the cache is and reuses that cache for the non-dynamic layers. If you know the area and map scale you will visit during a session of your mapping application, you can precook caches by zooming in and roaming to the area of interest and save the .mxd file in dynamic mode.
To persist the cache, save the layers and maps as .lyr and .mxd file respectively with dynamic display enabled. The next time dynamic display is enabled on the same or different session, it identifies the existing cache and re-uses it.
The following are some of the best practices to improve performance of dynamic display:
- Use rasters as background layers—R asters are considered cached datasets. Other data types, such as vectors, and CAD datasets are being cached on demand. R asters allow for changing display characteristics at runtime (such as changing renderer, spatial reference, contrast, histogram stretching, and so on) without having to rebuild the cache. In addition, saving a dataset as a raster gives the option to easily distribute the cache without having to deal with a cumbersome file based cache. Once a dataset is converted to a raster, it can be disconnected from the original dataset. Other datasets such as vector data will need to build up cache for optimal performance. For example, when using dynamic display to track a vehicle along a route, a raster layer which contains aerial photography of the area in question with the street network on top would be ideal. The cached datasets of the raster layer can be used and only the street network data need to be cached when the vehicle would be moving upon the screen.
Remove unused layers—Check the table of contents to ensure that your map document is clear of layers that are unrelated to the map's purpose.
Set scale dependent rendering for data layers—Use scale dependent rendering to ensure that unnecessary layers do not draw when the map is zoomed out. Data intensive or detailed layers can be more appropriate only when the map is zoomed in to a larger scale.
Use consolidated group layers—Using consolidated group layers display quicker and faster than layers that are not consolidated. Any layer that pertain to a composite layer (which also includes a group layers) are consolidated into one cache and therefore regardless of the number of layers contained in the composite layer, there will only be one cache to manage and add huge improvements in terms of performance
- Use annotation instead of labels—Since labels require the computer to make placement decisions, it's generally faster to use an annotation layer.
Set scale dependent rendering for labels—When a map is zoomed out, more labels need to be drawn, which takes time. Examine your map document and determine if some labels do not need to be shown at smaller scales.
In group layers, if a user reorders layers or turns layers visibility on or off most often, the dynamic display will be forced to rebuild the cache each time and it may affect the performance. Read the article ….. for more information.
This article summarizes the rendering of non-dynamic layers in dynamic mode. The non-dynamic layers are the layers that do not implement IDynamicLayer interface. They are rendered as tiles and managed by background threads. The tiles are cached and can also be reused for better performance. It is recommended to use raster layers and consolidated group layers as non-dynamic layers for better performance.
See Also:Controlling drawing characteristics of non-dynamic layers
|Development licensing||Deployment licensing|
|Engine Developer Kit||Engine|