WIP: loading layers from the database