You are here

public function FirstRow::getAvailableLocationOptions in Geolocation Field 8.3

Same name and namespace in other branches
  1. 8.2 src/Plugin/geolocation/Location/FirstRow.php \Drupal\geolocation\Plugin\geolocation\Location\FirstRow::getAvailableLocationOptions()

For one Location (i.e. boundary filter), return all options (all filters).

Parameters

mixed $context: Context like field formatter, field widget or view.

Return value

array Available location options indexed by ID.

Overrides LocationBase::getAvailableLocationOptions

File

src/Plugin/geolocation/Location/FirstRow.php, line 25

Class

FirstRow
Derive center from first row.

Namespace

Drupal\geolocation\Plugin\geolocation\Location

Code

public function getAvailableLocationOptions($context) {
  $options = [];
  if ($displayHandler = self::getViewsDisplayHandler($context)) {
    if ($displayHandler
      ->getPlugin('style')
      ->getPluginId() == 'maps_common') {
      $options['first_row'] = $this
        ->t('First row');
    }
  }
  return $options;
}