src/Helper/MapHelper.php
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);
    }
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);
    }
Renders a map control in the json builder.

@param \Ivory\GoogleMap\Map $map           The map.
@param string               $controlName   The control name.
@param mixed                $controlHelper The control helper.