You are here

public function MapStyle::__construct in Openlayers 8.4

File

src/MapStyle.php, line 15

Class

MapStyle
Contains details of how a style 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 = [];
  }
}