KeyboardZoom.php in Openlayers 8.4
File
src/Plugin/OpenlayersInteraction/KeyboardZoom.phpView source
<?php
namespace Drupal\openlayers\Plugin\OpenlayersInteraction;
use Drupal\Component\Utility\Color;
use Drupal\Component\Utility\Rectangle;
use Drupal\Core\Form\FormStateInterface;
use Drupal\openlayers\OpenlayersConfigurablePluginBase;
/**
* Defines the Keyboard Zoom interaction for an Openlayers map.
*
* @OpenlayersInteraction(
* id = "ol_interaction_keyboardzoom",
* label = @Translation("Keyboard zoom"),
* description = @Translation("Define a keyboard zoom interaction."),
* type = "interaction",
* ol_id = "KeyboardZoom"
* )
*/
class KeyboardZoom extends OpenlayersConfigurablePluginBase {
/**
* {@inheritdoc}
*/
public function getSummary() {
$summary = [
'#theme' => 'openlayers_control_summary',
'#data' => $this->configuration,
];
$summary += parent::getSummary();
return $summary;
}
/**
* {@inheritdoc}
*/
public function defaultConfiguration() {
return [];
}
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
/*
$form['color'] = [
'#type' => 'textfield',
'#default_value' => $this->configuration['color'],
'#title' => t('Fill color'),
'#description' => t('The color to be used for filling polygon features on the map. Use web-style hex colors (#FFFFFF for white, #000000 for black).'),
'#size' => 7,
'#maxlength' => 7,
'#required' => FALSE,
];
*/
return $form;
}
/**
* {@inheritdoc}
*/
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
}
/**
* {@inheritdoc}
*/
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
parent::submitConfigurationForm($form, $form_state);
// $this->configuration['color'] = $form_state->getValue('color');
}
}
Classes
Name![]() |
Description |
---|---|
KeyboardZoom | Defines the Keyboard Zoom interaction for an Openlayers map. |