You are here

public function MapInteraction::__construct in Openlayers 8.4

File

src/MapInteraction.php, line 15

Class

MapInteraction
Contains details of how a interaction is joined to a map.

Namespace

Drupal\openlayers

Code

public function __construct($configuration, $action) {
  if ($action == 'update' || $action == 'delete') {
    $this->id = $configuration['id'];
    $this->uuid = $configuration['uuid'];
    $this->configuration = isset($configuration['data']) ? $configuration['data'] : [];
  }
  else {
    $this->id = $configuration;
    $this->uuid = \Drupal::service('uuid')
      ->generate();
    $this->configuration = [];
  }
}