/[drupal]/contributions/modules/gmap/gmap_plugin_style_gmap.inc
ViewVC logotype

Diff of /contributions/modules/gmap/gmap_plugin_style_gmap.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.9 by bdragon, Fri Apr 3 15:34:50 2009 UTC revision 1.10 by bdragon, Tue Dec 1 16:08:57 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: gmap_plugin_style_gmap.inc,v 1.8 2009/03/11 17:39:20 bdragon Exp $  // $Id: gmap_plugin_style_gmap.inc,v 1.9 2009/04/03 15:34:50 bdragon Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 37  class gmap_plugin_style_gmap extends vie Line 37  class gmap_plugin_style_gmap extends vie
37    }    }
38    
39    function query() {    function query() {
40        parent::query();
41    
42      if ($this->options['datasource'] == 'location') {      if ($this->options['datasource'] == 'location') {
43        $table = $this->view->query->ensure_table('location');        $table = $this->view->query->ensure_table('location');
44        $this->view->query->add_field($table, 'latitude', 'gmap_lat');        $this->view->query->add_field($table, 'latitude', 'gmap_lat');
# Line 52  class gmap_plugin_style_gmap extends vie Line 54  class gmap_plugin_style_gmap extends vie
54      else if ($this->options['markers'] == 'userrole') {      else if ($this->options['markers'] == 'userrole') {
55        $this->view->query->add_field('users_roles', 'rid', 'gmap_role_marker');        $this->view->query->add_field('users_roles', 'rid', 'gmap_role_marker');
56      }      }
57    
58        if (isset($this->row_plugin)) {
59          $this->row_plugin->query();
60        }
61    }    }
62    
63      /**
64       * Render the display in this style.
65       */
66    function render() {    function render() {
67    
68      if (isset($this->view->live_preview) && $this->view->live_preview) {      if (isset($this->view->live_preview) && $this->view->live_preview) {
69        return t('GMap views are not compatible with live preview.');        return t('GMap views are not compatible with live preview.');
70      }      }
# Line 97  class gmap_plugin_style_gmap extends vie Line 107  class gmap_plugin_style_gmap extends vie
107      foreach ($sets as $title => $records) {      foreach ($sets as $title => $records) {
108        $markers = array();        $markers = array();
109        $offsets = array();        $offsets = array();
110          foreach ($records as $label => $row) {        foreach ($records as $row_index => $row) {
111            $this->view->row_index = $row_index;
112          $lat = (float)$row->{$lat_field};          $lat = (float)$row->{$lat_field};
113          $lon = (float)$row->{$lon_field};          $lon = (float)$row->{$lon_field};
114          if (!empty($lat) && !empty($lon)) {          if (!empty($lat) && !empty($lon)) {
# Line 143  class gmap_plugin_style_gmap extends vie Line 154  class gmap_plugin_style_gmap extends vie
154          $output .= theme($this->theme_functions(), $this->view, $this->options, $map, $title);          $output .= theme($this->theme_functions(), $this->view, $this->options, $map, $title);
155        }        }
156      }      }
157        unset($this->view->row_index);
158      return $output;      return $output;
159    }    }
160    

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.3