You are here

class QuickMap in Openlayers 7.2

Class for tab content of type "map" - this is for rendering a map as tab content.

Hierarchy

Expanded class hierarchy of QuickMap

1 string reference to 'QuickMap'
openlayers_quicktabs_contents in ./openlayers.module
Implements hook_quicktabs_contents().

File

plugins/quicktabs/QuickMap.inc, line 7

View source
class QuickMap extends QuickContent {
  public static function getType() {
    return 'map';
  }
  public function optionsForm($delta, $qt) {
    $tab = $this->settings;
    $form = array();
    $form['map']['map'] = array(
      '#type' => 'select',
      '#title' => t('OpenLayers Map'),
      '#options' => openlayers_map_options(),
      '#default_value' => isset($tab['map']) ? $tab['map'] : '',
    );
    return $form;
  }
  public function render($hide_empty = FALSE, $args = array()) {
    if ($this->rendered_content) {
      return $this->rendered_content;
    }
    $output = array();
    $item = $this->settings;

    // We should add a JS file here to automatically resize the map when
    // the map is not the default tab.
    $map = openlayers_map_load($item['map']);
    $render = openlayers_render_map($map);
    $output['#markup'] = $render;
    $this->rendered_content = $output;
    return $output;
  }
  public function getAjaxKeys() {
    return array(
      'map',
    );
  }

}

Members

Namesort descending Modifiers Type Description Overrides
QuickContent::$rendered_content protected property A render array of the contents.
QuickContent::$settings protected property An array containing the information that defines the tab content, specific to its type.
QuickContent::$title protected property Used as the title of the tab.
QuickContent::factory public static function Instantiate a content type object.
QuickContent::getSettings public function Accessor for the tab settings. Overrides QuickContentRenderable::getSettings
QuickContent::getTitle public function Accessor for the tab title. Overrides QuickContentRenderable::getTitle
QuickContent::__construct public function Constructor 2
QuickContentRenderable::getUniqueKeys public function Returns an array of keys, sufficient to represent the content uniquely. 6
QuickMap::getAjaxKeys 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::getAjaxKeys
QuickMap::getType public static function Returns the short type name of the content plugin, e.g. 'block', 'node', 'prerendered'. Overrides QuickContentRenderable::getType
QuickMap::optionsForm public function Method for returning the form elements to display for this tab type on the admin form. Overrides QuickContent::optionsForm
QuickMap::render public function Renders the content. Overrides QuickContentRenderable::render