Added optional callback when layer is loaded.