You are here

public function GoogleMaps::optionsForm in Openlayers 7.3

@TODO What is this return? If it is the form, why is form by reference?

Overrides Base::optionsForm

File

src/Plugin/Source/GoogleMaps/GoogleMaps.php, line 27
Google maps API integration based on the example here: http://openlayers.org/en/v3.0.0/examples/google-map.html http://bl.ocks.org/elemoine/e82c7dd4b1d0ef45a9a4

Class

GoogleMaps
Class GoogleMaps.

Namespace

Drupal\openlayers\Plugin\Source\GoogleMaps

Code

public function optionsForm(array &$form, array &$form_state) {
  $layer_types = array(
    'ROADMAP',
    'SATELLITE',
    'HYBRID',
    'TERRAIN',
  );
  $form['options']['key'] = array(
    '#title' => t('Key'),
    '#type' => 'textfield',
    '#default_value' => $this
      ->getOption('key', ''),
  );
  $form['options']['client'] = array(
    '#title' => t('Client'),
    '#type' => 'textfield',
    '#default_value' => $this
      ->getOption('client', ''),
  );
  $form['options']['channel'] = array(
    '#title' => t('Channel'),
    '#type' => 'textfield',
    '#default_value' => $this
      ->getOption('channel', ''),
  );
  $form['options']['mapTypeId'] = array(
    '#title' => t('Mapy Type'),
    '#type' => 'select',
    '#default_value' => $this
      ->getOption('mapTypeId', 'ROADMAP'),
    '#options' => array_combine($layer_types, $layer_types),
  );
  $form['options']['sensor'] = array(
    '#title' => t('Sensor'),
    '#type' => 'checkbox',
    '#default_value' => $this
      ->getOption('sensor', FALSE),
  );
}