You are here

public function Fractal::postBuild in Openlayers 7.3

Invoked after an objects render array is built.

Mostly invoked by the map object.

Parameters

array $build: The array with the build information.

\Drupal\openlayers\Types\ObjectInterface $context: The context of the build. Mostly the map object.

Overrides Base::postBuild

File

modules/openlayers_library/src/Plugin/Component/Fractal/Fractal.php, line 25
Component: Fractal.

Class

Fractal
Class Fractal.

Namespace

Drupal\openlayers_library\Plugin\Component\Fractal

Code

public function postBuild(array &$build, ObjectInterface $context = NULL) {
  $build['parameters'][$this
    ->getPluginId()] = array(
    '#type' => 'fieldset',
    '#title' => 'Example Fractal component',
    'swipe' => array(
      '#type' => 'rangefield',
      '#title' => 'Depth',
      '#min' => 0,
      '#max' => 10,
      '#step' => 1,
      '#value' => 5,
      '#attributes' => array(
        'id' => 'depth',
        'style' => 'width: 100%;',
      ),
    ),
    'count' => array(
      '#type' => 'item',
      '#title' => 'Points',
      '#markup' => '<span id="count"></span>',
    ),
    'length' => array(
      '#type' => 'item',
      '#title' => 'Length',
      '#markup' => '<span id="length"></span>',
    ),
  );
  $build['description']['#description'] = 'This example is based on the <a href="http://openlayers.org/en/master/examples/fractal.html">offical fractal example</a>. You need the <em><a href="https://drupal.org/project/elements">elements</a></em> module to get it working properly.';
}