Index: includes/behaviors/openlayers_behavior_cluster.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/openlayers/includes/behaviors/Attic/openlayers_behavior_cluster.inc,v retrieving revision 1.1.2.2 diff -u -p -r1.1.2.2 openlayers_behavior_cluster.inc --- includes/behaviors/openlayers_behavior_cluster.inc 7 Jun 2010 20:41:40 -0000 1.1.2.2 +++ includes/behaviors/openlayers_behavior_cluster.inc 14 Jul 2010 13:54:27 -0000 @@ -15,6 +15,7 @@ class openlayers_behavior_cluster extend */ function options_init() { return array( + 'clusterlayer' => array(), 'distance' => '20', 'threshold' => NULL, ); @@ -35,18 +36,19 @@ class openlayers_behavior_cluster extend $vector_layers = array(); foreach ($this->map['layers'] as $id => $name) { $layer = openlayers_layer_load($id); - if ($layer->data['layer_type'] == 'openlayers_views_vector') { + if (isset($layer->data['vector']) && $layer->data['vector'] == TRUE) { $vector_layers[$id] = $name; } } return array( 'clusterlayer' => array( - '#type' => 'select', + '#title' => t('Layers'), + '#type' => 'checkboxes', '#options' => $vector_layers, - '#description' => t('Select layer to cluster'), - '#default_value' => isset($defaults['clusterlayer']) ? - $defaults['clusterlayer'] : NULL, + '#description' => t('Select layers to cluster.'), + '#default_value' => isset($defaults['clusterlayer']) ? + $defaults['clusterlayer'] : array(), ), 'distance' => array( '#type' => 'textfield', Index: includes/behaviors/js/openlayers_behavior_cluster.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/openlayers/includes/behaviors/js/Attic/openlayers_behavior_cluster.js,v retrieving revision 1.1.2.2 diff -u -p -r1.1.2.2 openlayers_behavior_cluster.js --- includes/behaviors/js/openlayers_behavior_cluster.js 6 Jul 2010 03:26:48 -0000 1.1.2.2 +++ includes/behaviors/js/openlayers_behavior_cluster.js 14 Jul 2010 13:54:27 -0000 @@ -15,7 +15,14 @@ Drupal.behaviors.openlayers_cluster = fu var map = data.openlayers; var distance = parseInt(options.distance, 10); var threshold = parseInt(options.threshold, 10); - var layers = map.getLayersBy('drupalID', options.clusterlayer); + var layers = []; + for (var i in options.clusterlayer) { + /* FIXME: layers which haven't been loaded yet won't be found ! */ + var selectedLayer = map.getLayersBy('drupalID', options.clusterlayer[i]); + if (typeof selectedLayer[0] != 'undefined') { + layers.push(selectedLayer[0]); + } + } // Go through chosen layers for (var i in layers) {