public function getStack(GetObjectStackEvent $event)
    {
        $stack = array();
        $value = $event->getValue();

        if ($value instanceof Map) {
            foreach ($value->getControls() as $control) {
                if ($control instanceof Layers) {
                    $this->addLayersToStack($control->getBaseLayers(), $stack);
                    $this->addLayersToStack($control->getOverlays(), $stack);
                }

                $stack[] = $control;
            }

            $this->addLayersToStack($value->getLayers(), $stack);

            $event->setStack($stack);
        }
    }