moved portal_layer_id to metadata