You are here

function gmap_plugin_style_gmap::query in GMap Module 6.2

Same name and namespace in other branches
  1. 6 gmap_plugin_style_gmap.inc \gmap_plugin_style_gmap::query()
  2. 7.2 gmap_plugin_style_gmap.inc \gmap_plugin_style_gmap::query()
  3. 7 gmap_plugin_style_gmap.inc \gmap_plugin_style_gmap::query()

File

./gmap_plugin_style_gmap.inc, line 52
GMap style plugin.

Class

gmap_plugin_style_gmap
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();
  }
}