You are here

protected function CivicrmEntityAddressLeafletMap::getAvailableDataSources in CiviCRM Entity 8.3

Get a list of fields and a sublist of geo data fields in this view.

Return value

array Available data sources.

Overrides LeafletMap::getAvailableDataSources

1 call to CivicrmEntityAddressLeafletMap::getAvailableDataSources()
CivicrmEntityAddressLeafletMap::buildOptionsForm in modules/civicrm_entity_leaflet/src/Plugin/views/style/CivicrmEntityAddressLeafletMap.php
Provide a form to edit options for this plugin.

File

modules/civicrm_entity_leaflet/src/Plugin/views/style/CivicrmEntityAddressLeafletMap.php, line 40

Class

CivicrmEntityAddressLeafletMap
Style plugin to render a View output as a Leaflet map.

Namespace

Drupal\civicrm_entity_leaflet\Plugin\views\style

Code

protected function getAvailableDataSources() {
  $fields_geo_data = [];

  /* @var \Drupal\views\Plugin\views\ViewsHandlerInterface $handler) */
  foreach ($this->displayHandler
    ->getHandlers('field') as $field_id => $handler) {
    $label = $handler
      ->adminLabel() ?: $field_id;
    $this->viewFields[$field_id] = $label;
    if (is_a($handler, '\\Drupal\\views\\Plugin\\views\\field\\EntityField')) {
      $fields_geo_data[$field_id] = $label;
    }
  }
  return $fields_geo_data;
}