You are here

protected function CommonMapBase::getMapUpdateOptions in Geolocation Field 8.2

Map update option handling.

Dynamic map and client location and potentially others update the view by information determined on the client site. They may want to update the view result as well. So we need to provide the possible ways to do that.

Return value

array The determined options.

1 call to CommonMapBase::getMapUpdateOptions()
CommonMapBase::buildOptionsForm in src/Plugin/views/style/CommonMapBase.php
Provide a form to edit options for this plugin.

File

src/Plugin/views/style/CommonMapBase.php, line 93

Class

CommonMapBase
Allow to display several field items on a common map.

Namespace

Drupal\geolocation\Plugin\views\style

Code

protected function getMapUpdateOptions() {
  $options = [];
  foreach ($this->displayHandler
    ->getOption('filters') as $filter_id => $filter) {
    if (!empty($filter['plugin_id']) && $filter['plugin_id'] == 'geolocation_filter_boundary') {

      /** @var \Drupal\views\Plugin\views\filter\FilterPluginBase $filter_handler */
      $filter_handler = $this->displayHandler
        ->getHandler('filter', $filter_id);
      if ($filter_handler
        ->isExposed()) {
        $options['boundary_filter_' . $filter_id] = $this
          ->t('Boundary Filter') . ' - ' . $filter_handler
          ->adminLabel();
      }
    }
  }
  return $options;
}