The IlvTiledShapeDataSource is the tiled version
of the IlvShapeDataSource. This means that it takes
advantage of the tiling and load-on-demand mechanism. To read a
tiled shapefile with such a data source, you can use the following
code:
IlvTiledShapeDataSource source = new IlvTiledShapeDataSource(fileName); source.setManager(getManager()); try { source.start(); } catch (Exception e) { e.printStackTrace(); }
The IlvShapeFileTileLoader Class
This class implements load-on-demand for tiled Shapefiles. When
associated with an IlvTiledLayer, this class automatically
handles tile loading if the Shapefile file name, the IndexFile
file name, and the SpatialIndexFile file name are provided. An
optional Dbase file name can also be provided to load object
attributes.
IlvShapeFileTileLoader tileLoader = new IlvShapeFileTileLoader("example.shp", "example.dbf", // Or null if attributes loading // is not wanted. "example.shx", "example.idx"); IlvTiledLayer tiledLayer = new IlvTiledLayer(new IlvRect(), null, IlvTileController.FREE); tiledLayer.setTileLoader(tileLoader);