Maps > Using Load-On-Demand > Displaying the State of Tiles
 
Displaying the State of Tiles
You can create a debug view to display the state of the tiles in a tiled layer using the following method:
IlvTiledLayer::setDebugView(IlvView* view,
IlvColor* borderColor = 0,
IlvColor* lockedTilesColor = 0,
IlvColor* cachedTilesColor = 0)
As its name suggests, this debug view is particularly useful for debugging operations when implementing load-on-demand for a new cartographic format.
A tile can have four different states:
*empty: its objects are not loaded into memory,
*locked: its objects are loaded into memory and visible,
*cached: its objects are loaded into memory but not visible,
*deleted: its objects have been deleted from the cache.
The debug view is of the IlvView type, and must be attached to a tiled layer. The debug view does not increment nor decrement the tile lock counters. This is the role of the tile controller. It just displays the tiles in color according to their state, as in Figure 4.2
Figure 4.2    Load-on-Demand Debug View
The tiles with lock counters greater than 1 appear in blue. They are visible in at least one view. The tiles whith counters equal to 0 appear in yellow. They are cached. The white tiles are not loaded.
In the previous example, an IlvManagerMagViewInteractor was associated with the debug view. It is this interactor that displays a little yellow square inside the blue tile. The square shows the zone displayed by the main view.
The following example creates a debug view for a layer.
 
void
SimpleLod::debugView() {
_debug = new IlvView(_display,
"DebugView",
"DebugView",
IlvRect(450, 0, 100, 100),
IlvFalse, IlvFalse);
_manager->addView(_debug);
_tiledLayer->setDebugView(_debug);
}
 
The following code associates an IlvManagerMagViewInteractor with the debug view.
 
void
SimpleLod::magView()
{
_magvint = new IlvManagerMagViewInteractor(_manager, _debug, _view);
 
_magvint->setAutoZooming(IlvTrue);
_magvint->setAutoTranslating(IlvTrue);
_magvint->setResizingAllowed(IlvTrue);
 
_manager->setInteractor(_magvint, _debug);
}
 

Version 6.0
Copyright © 2015, Rogue Wave Software, Inc. All Rights Reserved.