/** * {@inheritdoc} */ protected function buildConstructArguments(\Model $model, DefinitionMapper $mapper, Filter $filter = null, $elementId = null) { $arguments = parent::buildConstructArguments($model, $mapper, $filter, $elementId); $arguments[1] = array(); $arguments[2] = array(); /** @var ControlModel $model */ $collection = $model->findActiveLayers(); if ($collection) { foreach ($collection as $layer) { $argument = $layer->controlMode === 'overlay' ? 2 : 1; $arguments[$argument][] = $mapper->handle($layer, $filter); } } return $arguments; }
/** * {@inheritdoc} */ protected function build(Definition $definition, \Model $model, DefinitionMapper $mapper, Filter $filter = null, Definition $parent = null) { parent::build($definition, $model, $mapper, $filter); if ($definition instanceof SpinJsLoadingControl && $model->spin) { $config = json_decode($model->spin, true); if (is_array($config)) { $definition->setSpin($config); } } if ($definition instanceof LoadingControl && !$definition->isSeparate() && $model->zoomControl) { // Only assign if zoom control is activated and part of the map. $control = ControlModel::findOneBy(array('active=1', 'type=?', 'pid=?', 'id=?'), array('zoom', $model->pid, $model->zoomControl)); if ($control) { $control = $mapper->handle($control); if ($control instanceof Zoom) { // By default the loading control overrides the position of the zoom control. Deactivate it by // overriding the position. $definition->setPosition($control->getPosition()); $definition->setZoomControl($control); } } } }
/** * {@inheritdoc} */ protected function initialize() { parent::initialize(); $this->optionsBuilder->addOption('forceSeparateButton', 'separate')->addConditionalOption('title', 'title', 'buttonTitle')->addOption('forcePseudoFullScreen', 'simulateFullScreen'); }
/** * {@inheritdoc} */ protected function initialize() { parent::initialize(); $this->optionsBuilder->addConditionalOption('prefix'); }