Index: includes/behaviors/js/openlayers_behavior_popup.js =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/openlayers/includes/behaviors/js/Attic/openlayers_behavior_popup.js,v retrieving revision 1.1.2.3 diff -U 2 -r1.1.2.3 openlayers_behavior_popup.js --- includes/behaviors/js/openlayers_behavior_popup.js 27 Jun 2010 13:55:25 -0000 1.1.2.3 +++ includes/behaviors/js/openlayers_behavior_popup.js 28 Jun 2010 10:53:03 -0000 @@ -22,11 +22,28 @@ */ Drupal.theme.prototype.openlayersPopup = function(feature) { - var output = - '
' + - feature.attributes.name + - '
' + - '
' + - feature.attributes.description + - '
'; + var output = ''; + if ( feature.cluster ) + { + var visited = []; // to keep trac of already-visited items + for(var i = 0; i < feature.cluster.length; i++) { + var pf = feature.cluster[i]; // pseudo-feature + // should we use layer.name rather than drupalID here ? + var mapwide_id = feature.layer.drupalID+pf.drupalFID; + // skip duplicates + if ( visited[mapwide_id] ) continue; + visited[mapwide_id] = true; + output += Drupal.theme.prototype.openlayersPopup(pf); + } + } + else + { + output += + '
' + + feature.attributes.name + + '
' + + '
' + + feature.attributes.description + + '
'; + } return output; }