summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrandon Bergren2010-11-30 22:08:45 (GMT)
committer Brandon Bergren2010-11-30 22:08:45 (GMT)
commit1f18ad62bd085627d13c0f988b3d95ab2d5aa2eb (patch)
treefe80cd4e8cdc3f40cce953df977d41998a14d4f7
parent74fd6ae684b31a4e17c49a69137e5b2ead4986ad (diff)
Move gmap_views_gmap preprocess function to gmap.module to work around caching quirks seen in the wild.
-rw-r--r--gmap.module15
-rw-r--r--gmap.views.inc13
2 files changed, 15 insertions, 13 deletions
diff --git a/gmap.module b/gmap.module
index 0a2bc31..c31d06f 100644
--- a/gmap.module
+++ b/gmap.module
@@ -1282,3 +1282,18 @@ function gmap_views_plugins() {
),
);
}
+
+/**
+ * Preprocess function for theme_gmap_view_gmap().
+ */
+function template_preprocess_gmap_view_gmap(&$vars) {
+ $vars['map_object'] = $vars['rows'];
+ // Rows is actually our map object.
+ unset($vars['rows']);
+ $vars['map_element'] = array(
+ '#type' => 'gmap',
+ '#gmap_settings' => $vars['map_object'],
+ );
+ // Theme the map.
+ $vars['map'] = drupal_render($vars['map_element']);
+}
diff --git a/gmap.views.inc b/gmap.views.inc
index 81d3f53..7fa08ef 100644
--- a/gmap.views.inc
+++ b/gmap.views.inc
@@ -24,16 +24,3 @@ function gmap_views_handlers() {
}
*/
-
-
-function template_preprocess_gmap_view_gmap(&$vars) {
- $vars['map_object'] = $vars['rows'];
- // Rows is actually our map object.
- unset($vars['rows']);
- $vars['map_element'] = array(
- '#type' => 'gmap',
- '#gmap_settings' => $vars['map_object'],
- );
- // Theme the map.
- $vars['map'] = drupal_render($vars['map_element']);
-}