openlayers-8.x-4.x-dev/src/Plugin/Interaction/DragPan/DragPan.php
src/Plugin/Interaction/DragPan/DragPan.php
<?php
namespace Drupal\openlayers\Plugin\Interaction\DragPan;
use Drupal\Core\Form\FormStateInterface;
use Drupal\openlayers\Types\Interaction;
/**
* FIX - Insert short comment here.
*
* @OpenlayersPlugin(
* id = "ol_interaction_dragpan",
* label = @Translation("Drag Pan"),
* description = @Translation("Allows the user to pan the map by dragging the map."),
* service = "openlayers.Interaction:DragPan",
* library = "openlayers-plugin-interaction-dragpan",
* is_configurable = "true",
* type = "interaction"
* )
*/
class DragPan extends Interaction {
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form['options']['decay'] = array(
'#type' => 'textfield',
'#title' => t('Decay'),
'#default_value' => $this->getOption('decay', -0.005),
'#description' => t('Rate of decay (must be negative).'),
);
$form['options']['minVelocity'] = array(
'#type' => 'textfield',
'#title' => t('Minimum velocity'),
'#default_value' => $this->getOption('minVelocity', 0.05),
'#description' => t('Minimum velocity (pixels/millisecond).'),
);
$form['options']['delay'] = array(
'#type' => 'textfield',
'#title' => t('Delay'),
'#default_value' => $this->getOption('delay', 100),
'#description' => t('Delay to consider to calculate the kinetic.'),
);
return $form;
}
}
