/**
  * {@inheritdoc}
  */
 protected function buildConstructArguments(\Model $model, DefinitionMapper $mapper, Filter $filter = null, $elementId = null)
 {
     if ($model->deferred) {
         if ($model->pointToLayer || $model->boundsMode) {
             $layer = new GeoJson($this->getElementId($model, $elementId));
             if ($model->pointToLayer) {
                 $layer->setPointToLayer(new Expression($model->pointToLayer));
             }
             if ($model->boundsMode) {
                 $layer->setOption('boundsMode', $model->boundsMode);
             }
             return array($this->getElementId($model, $elementId), RequestUrl::create($model->id, null, null, $filter), array(), $layer);
         }
         return array($this->getElementId($model, $elementId), RequestUrl::create($model->id, null, null, $filter));
     }
     return parent::buildConstructArguments($model, $mapper, $filter, $elementId);
 }
 /**
  * Add javascript callbacks.
  *
  * @param GeoJson $definition The definition.
  * @param \Model  $model      The database model.
  *
  * @return void
  */
 protected function addCallbacks(GeoJson $definition, \Model $model)
 {
     if ($model->pointToLayer) {
         $definition->setPointToLayer(new Expression($model->pointToLayer));
     }
     if ($model->onEachFeature) {
         $definition->setOnEachFeature(new Expression($model->onEachFeature));
     }
 }