You are here

function gmap_plugin_style_gmapextended::query in GMap Module 7

Same name and namespace in other branches
  1. 7.2 gmap_plugin_style_gmapextended.inc \gmap_plugin_style_gmapextended::query()

Add anything to the query that we might need to.

Overrides views_plugin_style::query

File

./gmap_plugin_style_gmapextended.inc, line 70
GMap style plugin.

Class

gmap_plugin_style_gmapextended
Style plugin to render a map.

Code

function query() {
  parent::query();
  if ($this->options['datasource'] == 'location') {
    $table = $this->view->query
      ->ensure_table('location');
    $this->view->query
      ->add_field($table, 'latitude', 'gmap_lat');
    $this->view->query
      ->add_field($table, 'longitude', 'gmap_lon');
  }
  if ($this->options['markers'] == 'nodetype') {
    $this->view->query
      ->add_field('node', 'type', 'gmap_node_type');
  }
  else {
    if ($this->options['markers'] == 'taxonomy') {
      $this->view->query
        ->add_field('gmap_taxonomy_node', 'marker', 'gmap_node_marker');
    }
    else {
      if ($this->options['markers'] == 'userrole') {
        $this->view->query
          ->add_field('users_roles', 'rid', 'gmap_role_marker');
      }
    }
  }
  if (isset($this->row_plugin)) {
    $this->row_plugin
      ->query();
  }
}