class MousePosition in Openlayers 8.4
Defines the Mouse Position control for an Openlayers map.
Plugin annotation
@OpenlayersControl(
id = "ol_control_mouseposition",
label = @Translation("Mouse position"),
description = @Translation("Define a mouse position control."),
type = "control",
ol_id = "MousePosition"
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\openlayers\OpenlayersPluginBase implements ContainerFactoryPluginInterface, OpenlayersPluginInterface
- class \Drupal\openlayers\OpenlayersConfigurablePluginBase implements OpenlayersConfigurablePluginInterface
- class \Drupal\openlayers\Plugin\OpenlayersControl\MousePosition
- class \Drupal\openlayers\OpenlayersConfigurablePluginBase implements OpenlayersConfigurablePluginInterface
- class \Drupal\openlayers\OpenlayersPluginBase implements ContainerFactoryPluginInterface, OpenlayersPluginInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of MousePosition
File
- src/
Plugin/ OpenlayersControl/ MousePosition.php, line 21
Namespace
Drupal\openlayers\Plugin\OpenlayersControlView source
class MousePosition extends OpenlayersConfigurablePluginBase {
/**
* {@inheritdoc}
*/
public function getSummary() {
$summary = [
'#theme' => 'openlayers_control_summary',
'#data' => $this->configuration,
];
$summary += parent::getSummary();
return $summary;
}
/**
* {@inheritdoc}
*/
public function defaultConfiguration() {
return [
'className' => 'ol-mouse-position',
];
}
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form['className'] = [
'#type' => 'textfield',
'#default_value' => $this->configuration['className'],
'#title' => t('Class name'),
'#description' => t('CSS class name.'),
'#size' => 50,
'#maxlength' => 50,
'#required' => FALSE,
];
/*
$form['coordinateFormat'] = [
'#type' => 'textfield',
'#default_value' => $this->configuration['coordinateFormat'],
'#title' => t('Coordinate format'),
'#description' => t('Coordinate format.'),
'#size' => 50,
'#maxlength' => 50,
'#required' => FALSE,
];
$form['projection'] = [
'#type' => 'textfield',
'#default_value' => $this->configuration['projection'],
'#title' => t('Projection'),
'#description' => t('Projection. Default is the view projection.'),
'#size' => 50,
'#maxlength' => 50,
'#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['className'] = $form_state
->getValue('className');
/*
$this->configuration['collapsible'] = $form_state->getValue('collapsible');
$this->configuration['collapsed'] = $form_state->getValue('collapsed');
$this->configuration['tipLabel'] = $form_state->getValue('tipLabel');
$this->configuration['label'] = $form_state->getValue('label');
$this->configuration['collapseLabel'] = $form_state->getValue('collapseLabel');
*/
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
MessengerTrait:: |
protected | property | The messenger. | 29 |
MessengerTrait:: |
public | function | Gets the messenger. | 29 |
MessengerTrait:: |
public | function | Sets the messenger. | |
MousePosition:: |
public | function |
Form constructor. Overrides PluginFormInterface:: |
|
MousePosition:: |
public | function |
Gets default configuration for this plugin. Overrides OpenlayersPluginBase:: |
|
MousePosition:: |
public | function |
Returns a render array summarizing the configuration of the image effect. Overrides OpenlayersPluginBase:: |
|
MousePosition:: |
public | function |
Form submission handler. Overrides OpenlayersConfigurablePluginBase:: |
|
MousePosition:: |
public | function |
Form validation handler. Overrides OpenlayersConfigurablePluginBase:: |
|
OpenlayersPluginBase:: |
protected | property | A logger instance. | |
OpenlayersPluginBase:: |
protected | property | The image effect ID. | |
OpenlayersPluginBase:: |
protected | property | The weight of the image effect. | |
OpenlayersPluginBase:: |
public | function |
Calculates dependencies for the configured plugin. Overrides DependentPluginInterface:: |
|
OpenlayersPluginBase:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
OpenlayersPluginBase:: |
public | function |
Gets this plugin's configuration. Overrides ConfigurableInterface:: |
|
OpenlayersPluginBase:: |
public | function |
Returns the extension of the derivative after applying this image effect. Overrides OpenlayersPluginInterface:: |
|
OpenlayersPluginBase:: |
public | function |
Returns the unique ID representing the image effect. Overrides OpenlayersPluginInterface:: |
|
OpenlayersPluginBase:: |
public | function |
Returns the weight of the image effect. Overrides OpenlayersPluginInterface:: |
|
OpenlayersPluginBase:: |
public | function |
Returns the image effect label. Overrides OpenlayersPluginInterface:: |
|
OpenlayersPluginBase:: |
public | function |
Sets the configuration for this plugin instance. Overrides ConfigurableInterface:: |
|
OpenlayersPluginBase:: |
public | function |
Sets the weight for this image effect. Overrides OpenlayersPluginInterface:: |
|
OpenlayersPluginBase:: |
public | function |
Determines the dimensions of the styled image. Overrides OpenlayersPluginInterface:: |
|
OpenlayersPluginBase:: |
public | function |
Constructs a \Drupal\Component\Plugin\PluginBase object. Overrides PluginBase:: |
|
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |