You are here

public function Geolocation::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/Geolocation/Geolocation.php, line 60
Component: Geolocation.

Class

Geolocation
Class Geolocation.

Namespace

Drupal\openlayers_library\Plugin\Component\Geolocation

Code

public function postBuild(array &$build, ObjectInterface $context = NULL) {
  $build['parameters'][$this
    ->getPluginId()] = array(
    '#type' => 'fieldset',
    '#title' => 'Example Geolocation component',
    'info' => array(
      '#markup' => '<div id="info"></div>',
    ),
    'trackPosition' => array(
      '#type' => 'checkbox',
      '#title' => 'Track position',
      '#attributes' => array(
        'id' => 'trackPosition',
      ),
    ),
    'positionAccuracy' => array(
      '#type' => 'textfield',
      '#title' => 'Position accuracy',
      '#attributes' => array(
        'id' => 'positionAccuracy',
      ),
    ),
    'altitude' => array(
      '#type' => 'textfield',
      '#title' => 'Altitude',
      '#attributes' => array(
        'id' => 'altitude',
      ),
    ),
    'altitudeAccuracy' => array(
      '#type' => 'textfield',
      '#title' => 'Altitude accuracy',
      '#attributes' => array(
        'id' => 'altitudeAccuracy',
      ),
    ),
    'heading' => array(
      '#type' => 'textfield',
      '#title' => 'Heading',
      '#attributes' => array(
        'id' => 'heading',
      ),
    ),
    'speed' => array(
      '#type' => 'textfield',
      '#title' => 'Speed',
      '#attributes' => array(
        'id' => 'speed',
      ),
    ),
  );
}