Giuseppe,

"treshold" should be "threshold". I also have "distance: 50"

Regards,

Donald




From: openlayers-users-boun...@lists.osgeo.org
[mailto:openlayers-users-boun...@lists.osgeo.org] On Behalf Of Giuseppe
Falcone
Sent: 05 November 2013 15:26
To: openlayers-users@lists.osgeo.org
Subject: [OpenLayers-Users] cluster strategy problem

Hi all,

I have a problem with a WFS Vector layer that return data in geoJSON format.
I have implemented this strategies:

"strategies": [
          new OpenLayers.Strategy.BBOX(),
          new OpenLayers.Strategy.Cluster({treshold:3})
 ]

this is my layer style configuration:
"styleMap": new OpenLayers.StyleMap({
     "default": new OpenLayers.Style({
           externalGraphic: "core/stub/simpleIcon.png",
                 label: "${label}",
                 cursor: "pointer"
           },
           {
               context:{
                   externalGraphic: function(feature) {
                        if (feature.cluster)
                              feature.attributes.externalGraphic =
"core/stub/clusterIcon.png";
                        return feature.attributes.externalGraphic;
                   },
                   label: function(feature) {
                         return feature.cluster ? feature.cluster.length :
"";
                    }
                }
              })
 })

Well, the features returned have always cluster attribute, also if the
feature is isolated there is a cluster array that contains a single feature.
In this manner I see always cluster icons, also on single feature. Anyone
has some ideas?
Thanks a lot.
Giuseppe


_______________________________________________
Users mailing list
us...@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to