Fixed edge creation.
Introduced field 'layer' that specifies which layers should be shown.