/**
  * Set the data property.
  *
  * @param \Model  $model   The model.
  * @param Feature $feature The feature.
  *
  * @return void
  */
 protected function setDataProperty($model, $feature)
 {
     if ($model->featureData) {
         $feature->setProperty('data', json_decode($model->featureData, true));
     }
 }
示例#2
0
 /**
  * Get marker as geo json feature.
  *
  * @return Feature
  */
 public function toGeoJsonFeature()
 {
     $feature = new Feature($this, $this->getId());
     $options = $this->getOptions();
     if ($this->getIcon()) {
         $feature->setProperty('icon', $this->getIcon()->getId());
         unset($options['icon']);
     }
     $feature->setProperty('options', $options);
     return $feature;
 }