Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function getCollection()
 {
     if (!$this->collection instanceof Collection) {
         $this->collection = \Drupal::service('openlayers.Types')->createInstance('Collection');
         $this->collection->append($this);
         $this->buildCollection();
     }
     return $this->collection;
 }
Beispiel #2
0
 /**
  * {@inheritdoc}
  */
 public function getCollection()
 {
     if (is_null($this->collection) || !$this->collection instanceof Collection) {
         $this->collection = \Drupal::service('openlayers.Types')->createInstance('Collection');
         $this->collection->import($this->optionsToObjects());
         $this->collection->append($this);
     }
     return $this->collection;
 }
 /**
  * Merges another collection into this one.
  *
  * @param \Drupal\openlayers\Types\Collection $collection
  *   The collection to merge into this one.
  */
 public function merge(Collection $collection)
 {
     foreach ($collection->getFlatList() as $object) {
         $this->prepend($object);
     }
 }
 /**
  * Merges another collection into this one.
  *
  * @param \Drupal\openlayers\Types\Collection $collection
  *   The collection to merge into this one.
  */
 public function merge(Collection $collection)
 {
     foreach ($collection->getObjects() as $objects) {
         foreach ($objects as $object) {
             $this->append($object);
         }
     }
 }