private function convertLegend(array $property, bool $trans, $condition, array &$legend, array &$result)
    {
        if (!empty($legend['properties'])) {
            $result['legend' . (\count($result) + 1)] = $legend;
        }
        $legend = [
            'label'      => $trans
                ? unserialize($property['legendtitle'], ['allowed_classes' => false])
                : ['' => $property['legendtitle']],
            'hide'       => (bool) $property['legendhide'],
            'properties' => [],
            'condition' => $condition($property)
        ];
    }