It you have a data format or readers that support
tiles, you may have to create the tiles and tile
loaders in a specific
start
method. Here
is an example used in the shapefile data source:
public void start() throws Exception
{
// construct a tiled shape tile loader
IlvShapeFileTileLoader tileLoader = new IlvShapeFileTileLoader(shp, dbf,shx,
idx);
tileLoader.setCoordinateSystem(getCoordinateSystem());
tileLoader.setFeatureRenderer(getFeatureRenderer());
// create a threaded tile loader to load the shape data on a background thread.
IlvTiledLayer tiledLayer = (IlvTiledLayer)getInsertionLayer().
getManagerLayer();
IlvThreadedTileLoader threadedLoader = new IlvThreadedTileLoader(tileLoader,
true);
tiledLayer.setTileLoader(threadedLoader);
...
// for each tile known by the tile loader
for (int i = ...) {
for (int j = ...) {
// Compute projected tile bounds, ie the bounds of the tile in the manager
coordinates
IlvRect r = IlvMapUtil.computeTransformedBounds(...);
Point2D.Double ul = new Point2D.Double(r.getX(), r.getY());
Point2D.Double lr = new Point2D.Double(r.getX() + r.getWidth(), r.getY()
+ r.getHeight());
tiledLayer.getTileController().addTile(new IlvMapFreeTile(ul, lr,
tiledLayer.getTileController(), i, j));
}
}
}