You are here

public function ColorizedGmapBlock::blockForm in Colorized google maps block 8

Overrides BlockPluginTrait::blockForm

File

src/Plugin/Block/ColorizedGmapBlock.php, line 82

Class

ColorizedGmapBlock
Provides a 'Example: configurable text string' block.

Namespace

Drupal\colorized_gmap\Plugin\Block

Code

public function blockForm($form, FormStateInterface $form_state) {

  // Check Google API Key.
  $this
    ->checkApiKey();
  $form['#attached']['library'][] = 'colorized_gmap/colorized_gmap.gmap_api';
  $form['#attached']['library'][] = 'colorized_gmap/colorized_gmap.block_admin';
  $form['#attached']['drupalSettings'] = $this
    ->getFormattedJsMapAdminSettings();

  // Build long settings form.
  $this
    ->buildFormStylers($form, $form_state);
  $this
    ->buildFormCoordinates($form, $form_state);
  $form['additional_settings'] = [
    '#type' => 'fieldset',
    '#tree' => TRUE,
    '#title' => $this
      ->t('Additional gmap api settings'),
    '#weight' => 4,
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  ];
  $this
    ->buildFormZoom($form, $form_state);
  $this
    ->buildFormControls($form, $form_state);
  $this
    ->buildFormControlsPosition($form, $form_state);
  $this
    ->buildFormMarker($form, $form_state);
  return $form;
}