Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 protected function build(Definition $definition, \Model $model, DefinitionMapper $mapper, Filter $filter = null, Definition $parent = null)
 {
     parent::build($definition, $model, $mapper, $filter, $parent);
     /** @var Popup $definition */
     /** @var PopupModel $model */
     $this->deserializePoint('offset', $definition, $model);
     if ($model->autoPan) {
         $padding = array_map(function ($value) {
             return array_map('intval', trimsplit(',', $value));
         }, deserialize($model->autoPanPadding, true));
         if ($padding[0] === $padding[1]) {
             if (!empty($padding[0])) {
                 $definition->setAutoPanPadding($padding[0]);
             }
         } else {
             if ($padding[0]) {
                 $definition->setAutoPanPaddingTopLeft($padding[0]);
             }
             if ($padding[1]) {
                 $definition->setAutoPanPaddingBottomRight($padding[1]);
             }
         }
     }
     if (!$model->closeOnClick) {
         $definition->setCloseOnClick(false);
     }
 }
 /**
  * {@inheritdoc}
  */
 public function match($model, Filter $filter = null)
 {
     return parent::match($model) && $model->type === static::$type;
 }
Esempio n. 3
0
 /**
  * {@inheritdoc}
  */
 protected function buildConstructArguments(\Model $model, DefinitionMapper $mapper, Filter $filter = null, $elementId = null)
 {
     $arguments = parent::buildConstructArguments($model, $mapper, $filter, $elementId);
     $arguments[] = array($model->latitude, $model->longitude, $model->altitude ?: null) ?: null;
     return $arguments;
 }