protected function renderMapControl(Map $map, $controlName, $controlHelper)
    {
        $lcFirstControlName = lcfirst($controlName);

        if (!$map->hasMapOption($lcFirstControlName)) {
            return;
        }

        $this->jsonBuilder->setValue(
            sprintf('[%s]', $lcFirstControlName),
            (bool) $map->getMapOption($lcFirstControlName)
        );

        if ($map->getMapOption($lcFirstControlName)) {
            $hasControlMethod = 'has'.$controlName;
            if ($map->$hasControlMethod()) {
                $getControlMethod = 'get'.$controlName;

                $this->jsonBuilder->setValue(
                    sprintf('[%sOptions]', $lcFirstControlName),
                    $controlHelper->render($map->$getControlMethod()),
                    false
                );
            }
        }

        $map->removeMapOption($lcFirstControlName);
    }