The TileMap is an Tilemap-Node with Tiles (Wall, Door, etc)
Script:
The tile names are in an enum.
enum Tile {Wall, Door, Floor, Ladder, Stone}
The tile_map is a reference to the Node
onready var tile_map = $ TileMap
Then with
tile_map.set_cell (x, y, Tile.stone)
for example the numerical value of the stone written into the tile_map.
At first the whole map is filled with stone-tiles, after that rooms and floors are placed.
the visbilityMap is completely filled with black tiles and then with a successful intersect_ray the black tile is removed by -1. (see Line 362 in the code-screen)
Without a yield nearly one-half of the screen was visible (black tiles removed from the visibilityMap) - with the yield everything looks fine.
I would prefer not to wait for an approximate amount of time that only fits my system. I would prefer a specific call of the update_visuals function when the work is finished.