? olviews_2_views_display.patch
Index: modules/openlayers_views/includes/openlayers_views.layers.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/openlayers/modules/openlayers_views/includes/Attic/openlayers_views.layers.inc,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 openlayers_views.layers.inc
--- modules/openlayers_views/includes/openlayers_views.layers.inc	28 Sep 2009 05:22:48 -0000	1.1.2.2
+++ modules/openlayers_views/includes/openlayers_views.layers.inc	3 Dec 2009 03:50:55 -0000
@@ -34,15 +34,11 @@ function openlayers_views_process_layers
         $args = $current_view->args;
         $view->set_exposed_input($current_view->exposed_input);
       }
-    
-      $view->execute_display($l['views']['display'], $args);
-      $view->init_style();
-      
-      $layer['features'] = $view->style_plugin->pre_render($view->result);
-      
-      $view->destroy();          
-     }
-   }
+
+      $processed[$k]['features'] = $view->execute_display($l['views']['display'], $args);
+      $view->destroy();
+    }
+  }
   return $layer;
 
 }
Index: modules/openlayers_views/views/openlayers_views.views.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/openlayers/modules/openlayers_views/views/openlayers_views.views.inc,v
retrieving revision 1.3.2.2
diff -u -p -r1.3.2.2 openlayers_views.views.inc
--- modules/openlayers_views/views/openlayers_views.views.inc	9 Nov 2009 16:12:35 -0000	1.3.2.2
+++ modules/openlayers_views/views/openlayers_views.views.inc	3 Dec 2009 03:50:55 -0000
@@ -14,6 +14,19 @@
 function openlayers_views_views_plugins() {
   return array(
     'module' => 'openlayers_views',
+    'display' => array(
+      'openlayers' => array(
+        'title' => t('OpenLayers Data'),
+        'help' => t('Data layer for OpenLayers maps.'),
+        'handler' => 'openlayers_views_plugin_display_openlayers',
+        'path' => drupal_get_path('module', 'openlayers_views') .'/views',
+        'uses hook menu' => FALSE,
+        'use ajax' => FALSE,
+        'use pager' => FALSE,
+        'accept attachments' => FALSE,
+        'admin' => t('OpenLayers Data'),
+      ),
+    ),
     'style' => array(
       'openlayers_map' => array(
         'title' => t('OpenLayers Map'),
@@ -37,12 +50,12 @@ function openlayers_views_views_plugins(
         'theme path' => drupal_get_path('module', 'openlayers_views') .'/views',
         'path' => drupal_get_path('module', 'openlayers_views') .'/views',
         'uses fields' => TRUE,
-        'uses row plugin' => TRUE,
+        'uses row plugin' => FALSE,
         'uses options' => TRUE,
         'uses grouping' => TRUE,
-        'type' => 'normal',
+        'type' => 'openlayers',
         'even empty' => TRUE,
       ),
     ),
   );
-}
\ No newline at end of file
+}
Index: modules/openlayers_views/views/openlayers_views_plugin_display_openlayers.inc
===================================================================
RCS file: modules/openlayers_views/views/openlayers_views_plugin_display_openlayers.inc
diff -N modules/openlayers_views/views/openlayers_views_plugin_display_openlayers.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/openlayers_views/views/openlayers_views_plugin_display_openlayers.inc	3 Dec 2009 03:50:55 -0000
@@ -0,0 +1,46 @@
+<?php
+class openlayers_views_plugin_display_openlayers extends views_plugin_display {
+  function uses_breadcrumb() { return FALSE; }
+  function get_style_type() { return 'openlayers'; }
+
+  /**
+   * OpenLayers data features are used directly in the map object.
+   */
+  function execute() {
+    return $this->view->render();
+  }
+
+  function preview() {
+    return '<pre>' . check_plain($this->view->render()) . '</pre>';
+  }
+
+  /**
+   * Instead of going through the standard views_view.tpl.php, delegate this
+   * to the style handler.
+   */
+  function render() {
+    return $this->view->style_plugin->render($this->view->result);
+  }
+
+  function option_definition() {
+    $options = parent::option_definition();
+
+    $options['displays'] = array('default' => array());
+
+    // Overrides for standard stuff:
+    $options['style_plugin']['default'] = 'openlayers_data';
+    $options['row_plugin']['default'] = '';
+    $options['defaults']['default']['row_plugin'] = FALSE;
+    $options['defaults']['default']['row_options'] = FALSE;
+    return $options;
+  }
+
+  function options_summary(&$categories, &$options) {
+    parent::options_summary($categories, $options);
+    unset($options['header']);
+    unset($options['footer']);
+    unset($options['empty']);
+    unset($options['exposed_block']);
+    unset($options['analyze-theme']);
+  }
+}
Index: modules/openlayers_views/views/openlayers_views_style_data.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/openlayers/modules/openlayers_views/views/openlayers_views_style_data.inc,v
retrieving revision 1.1.2.4
diff -u -p -r1.1.2.4 openlayers_views_style_data.inc
--- modules/openlayers_views/views/openlayers_views_style_data.inc	12 Nov 2009 17:46:29 -0000	1.1.2.4
+++ modules/openlayers_views/views/openlayers_views_style_data.inc	3 Dec 2009 03:50:56 -0000
@@ -217,32 +217,16 @@ class openlayers_views_style_data extend
   }
 
   /**
-   * Returns an array of features for the map (data for an OL map view)
+   * Render the map features.
    */
-  function pre_render() {
-    // Group the rows according to the grouping field, if specified.
-    $grouped = !empty($this->options['grouping']) ? TRUE : FALSE;
-    $sets = $this->render_grouping($this->view->result, $this->options['grouping']);
-    
-    $features = array();
-    $features = $this->map_features($sets);                
-    return $features;
-  }
-  
-  /**
-   * Called by view_ui, do some basic checks
-   */
-  function render() {
+  function render($result) {
     // Check for live preview.
     if (!empty($this->view->live_preview)) {
       return t('OpenLayers views are not compatible with live preview.');
     }
-    
-    // Check row plugin if using it.
-    if (empty($this->row_plugin)) {
-      drupal_set_message("Mising Row Plug-in", "error");
-      vpr('views_plugin_style_default: Missing row plugin');
-      return;
-    }
+
+    // Group the rows according to the grouping field, if specified.
+    $sets = $this->render_grouping($result, $this->options['grouping']);
+    return $this->map_features($sets);
   }
 }
