You are here

public function Group::optionsToObjects in Openlayers 7.3

Return a flat array containing Openlayers Objects from the options array.

Return value

ObjectInterface[] Return a list of objects.

Overrides Layer::optionsToObjects

File

src/Plugin/Layer/Group/Group.php, line 184
Layer: Heatmap.

Class

Group
Class Group.

Namespace

Drupal\openlayers\Plugin\Layer\Group

Code

public function optionsToObjects() {
  $import = array();
  foreach ($this
    ->getOption('grouplayers', array()) as $weight => $object) {
    if ($merge_object = Openlayers::load('layer', $object)) {
      $merge_object
        ->setWeight($this
        ->getWeight() - 1);
      $import[] = $merge_object;
    }
  }
  return $import;
}