You are here

public function Geocode::defaultConfiguration in Search API Location 8

Gets default configuration for this plugin.

Return value

array An associative array with the default configuration.

Overrides LocationInputPluginBase::defaultConfiguration

File

modules/search_api_location_geocoder/src/Plugin/search_api_location/location_input/Geocode.php, line 107

Class

Geocode
Represents the Raw Location Input.

Namespace

Drupal\search_api_location_geocoder\Plugin\search_api_location\location_input

Code

public function defaultConfiguration() {
  $configuration = parent::defaultConfiguration();
  $configuration['plugins'] = [];
  $geocoderpluginmanager = \Drupal::service('plugin.manager.geocoder.provider');
  foreach ($geocoderpluginmanager
    ->getPluginsAsOptions() as $plugin_id => $plugin_name) {
    $configuration['plugins'][$plugin_id]['checked'] = 0;
    $configuration['plugins'][$plugin_id]['weight'] = 0;
  }
  return $configuration;
}