Programming with JViews Maps > Creating a Map Application Using the API > Writing a Data Source > Layer Management

By default, the base IlvMapDataSource class layer manager creates a map layer when needed, and connects it to the manager (by creating an IlvManagerLayer).

Usually, the only layer management method you have to rewrite is the initInsertionLayer method, when you need to create a tiled layer instead of a standard IlvManagerLayer:

protected void initInsertionLayer(IlvMapLayer layer) {
    layer.insert(new IlvTiledLayer(new IlvRect(), null, IlvTileController.FREE));
}

If you want your data source to manage more than a single map layer you may have to write more complex layer management code, or create a subclass of the IlvHierarchicalDataSource.