class OpenlayersMap in Openlayers 7.3
Class for tab content of type "openlayers_map".
This is for rendering a map as tab content.
Hierarchy
- class \QuickContent implements QuickContentRenderable
- class \OpenlayersMap
Expanded class hierarchy of OpenlayersMap
1 string reference to 'OpenlayersMap'
- openlayers_quicktabs_quicktabs_contents in modules/
openlayers_quicktabs/ openlayers_quicktabs.module - Implements hook_quicktabs_contents().
File
- modules/
openlayers_quicktabs/ plugins/ quicktabs/ OpenlayersMap.php, line 13 - Openlayers quicktab plugin.
View source
class OpenlayersMap extends QuickContent {
/**
* {@inheritdoc}
*/
public static function getType() {
return 'Openlayers-map';
}
/**
* {@inheritdoc}
*/
public function optionsForm($delta, $qt) {
$tab = $this->settings;
$form = array();
$form['Openlayers-map']['map'] = array(
'#type' => 'select',
'#title' => t('Openlayers map'),
'#options' => \Drupal\openlayers\Openlayers::loadAllAsOptions('Map'),
"#empty_option" => t('- Select a map -'),
'#default_value' => isset($tab['openlayers_map']) ? $tab['openlayers_map'] : '',
);
return $form;
}
/**
* {@inheritdoc}
*/
public function render($hide_empty = FALSE, $args = array()) {
if ($this->rendered_content) {
return $this->rendered_content;
}
$item = $this->settings;
$output = array(
'#type' => 'openlayers',
'#map' => $item['map'],
);
$this->rendered_content = $output;
return $output;
}
/**
* {@inheritdoc}
*/
public function getAjaxKeys() {
return array(
'Openlayers-map',
);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
OpenlayersMap:: |
public | function |
Returns an array of keys to use for constructing the correct arguments for
an ajax callback to retrieve content of this type. The order of the keys
returned affects the order of the args passed in to the render method when
called via ajax (see the… Overrides QuickContentRenderable:: |
|
OpenlayersMap:: |
public static | function |
Returns the short type name of the content plugin, e.g. 'block', 'node',
'prerendered'. Overrides QuickContentRenderable:: |
|
OpenlayersMap:: |
public | function |
Method for returning the form elements to display for this tab type on
the admin form. Overrides QuickContent:: |
|
OpenlayersMap:: |
public | function |
Renders the content. Overrides QuickContentRenderable:: |
|
QuickContent:: |
protected | property | A render array of the contents. | |
QuickContent:: |
protected | property | An array containing the information that defines the tab content, specific to its type. | |
QuickContent:: |
protected | property | Used as the title of the tab. | |
QuickContent:: |
public static | function | Instantiate a content type object. | |
QuickContent:: |
public | function |
Accessor for the tab settings. Overrides QuickContentRenderable:: |
|
QuickContent:: |
public | function |
Accessor for the tab title. Overrides QuickContentRenderable:: |
|
QuickContent:: |
public | function | Constructor | 2 |
QuickContentRenderable:: |
public | function | Returns an array of keys, sufficient to represent the content uniquely. | 6 |