You are here

GeolocationGpxMapFormatter.php in Geolocation Field 8.3

File

modules/geolocation_gpx/src/Plugin/Field/FieldFormatter/GeolocationGpxMapFormatter.php
View source
<?php

namespace Drupal\geolocation_gpx\Plugin\Field\FieldFormatter;

use Drupal\Core\Form\FormStateInterface;
use Drupal\geolocation\Plugin\Field\FieldFormatter\GeolocationMapFormatterBase;

/**
 * Plugin implementation of the 'geofield' formatter.
 *
 * @FieldFormatter(
 *   id = "geolocation_gpx_file",
 *   module = "geolocation",
 *   label = @Translation("Geolocation GPX Formatter - Map"),
 *   field_types = {
 *     "geolocation_gpx_file",
 *     "file"
 *   }
 * )
 */
class GeolocationGpxMapFormatter extends GeolocationMapFormatterBase {

  /**
   * {@inheritdoc}
   */
  protected static $dataProviderId = 'geolocation_gpx';

  /**
   * {@inheritdoc}
   */
  public function settingsForm(array $form, FormStateInterface $form_state) {
    $element = parent::settingsForm($form, $form_state);
    unset($element['set_marker']);

    // @TODO: re-enable?
    unset($element['title']);
    unset($element['info_text']);
    unset($element['replacement_patterns']);
    return $element;
  }

}

Classes

Namesort descending Description
GeolocationGpxMapFormatter Plugin implementation of the 'geofield' formatter.