The cluster (x,y) position is created using the first feature.geometry
coordinates. To have a cluster that is "at the center" of the data it
clusters, I would propose to update its position using all the feature
added to the cluster. Something like this :

     addToCluster: function(cluster, feature) {
+        //update pos of the cluster to the mean pos of the features
+        var bounds = cluster.geometry.getBounds();
+        bounds.extend(feature.geometry.getBounds(););
         cluster.cluster.push(feature);
         cluster.attributes.count += 1;
+        cluster.geometry = bounds.getCenterLonLat();
     },

What do you think about that ? Interesting or not ? Is it worth
submitting a patch for it ?

Didrik

-- 
Didrik Pinte - Gérant/Manager

Dipole Consulting SPRL
E-mail : [EMAIL PROTECTED]
Tel    : +32 (0)10 77 90 05
Mobile : +32 (0)475 665 668
Fax    : +32 (0)2 791 56 61
Web    : http://www.dipole-consulting.com 

TVA    : BE.0895.560.517

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to