You are here

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

Ajax callback for updating colorized map settings.

Parameters

array $form: Form array.

\Drupal\Core\Form\FormStateInterface $form_state: Form state.

Return value

\Drupal\Core\Ajax\AjaxResponse Ajax response.

File

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

Class

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

Namespace

Drupal\colorized_gmap\Plugin\Block

Code

public function stylesMapUpdateCallback(array &$form, FormStateInterface $form_state) {
  $values = $form_state
    ->getValues();
  $settings = ColorizedGmapBlock::getFormattedJsMapAdminSettings($values['settings']);
  $response = new AjaxResponse();
  $response
    ->addCommand(new SettingsCommand($settings, TRUE));
  return $response;
}