Hello All,<div><br></div><div>I&#39;m trying to apply clustering strategy to a feature layer which i construct from lat/long points returned in JSON by a web service. When the map loads, all i can see is the string &#39;undefined&#39; at each and every point. I think there is some problem with the activation of the cluster strategy. I debugged the functions and found out that there is a problem with the code line which uses &quot; feature.attributes.count&quot;. Any one knows how do i get the clustering strategy to work?</div>
<div>I have included the code which I have written below. Any help will be appreciated.</div><div><div><br></div><div><br></div><div><div>        resultObject = $.parseJSON(jsonResponse.d);</div><div>        var point;</div>
<div>        var feature_point;</div><div>        var proj = new OpenLayers.Projection(&quot;EPSG:4326&quot;);        </div><div><br></div><div>        var vector_layer = new OpenLayers.Layer.Vector(&#39;Customer Points Layer&#39;, { strategies: [new OpenLayers.Strategy.Cluster()]});</div>
<div>        </div><div>        //Add data points to the feature layer by converting to the appropriate projection</div><div>        for (var customerCount = 0; customerCount &lt; resultObject.length; customerCount += 1) {</div>
<div>            point = new OpenLayers.Geometry.Point(resultObject[customerCount].Longitude, resultObject[customerCount].Latitude);</div><div>            point.transform(proj, map.getProjectionObject());</div><div>            feature_point = new OpenLayers.Feature.Vector(point);</div>
<div>            vector_layer.addFeatures([feature_point]);</div><div>        }</div><div><br></div><div>        var vector_style = new OpenLayers.Style({</div><div>            fillColor: &#39;#669933&#39;,</div><div>            fillOpacity: .8,</div>
<div>            fontColor: &#39;#f0f0f0&#39;,</div><div>            fontFamily: &#39;arial, sans-serif&#39;,</div><div>            fontSize: &#39;.9em&#39;,</div><div>            fontWeight: &#39;bold&#39;,</div><div>            label: &#39;${num_points}&#39;,</div>
<div>            pointRadius: &#39;${point_radius}&#39;,</div><div>            strokeColor: &#39;#aaee77&#39;,</div><div>            strokeWidth: 3</div><div>        },</div><div>           {</div><div>            context: {</div>
<div>                num_points: function (feature) { return feature.attributes.count; },</div><div>                point_radius: function (feature) {</div><div>                    return 9 + (feature.attributes.count)</div>
<div>                }</div><div>            }</div><div>        });</div><div><br></div><div>         var vector_style_map = new OpenLayers.StyleMap({</div><div>            &#39;default&#39;: vector_style            </div>
<div>        });</div><div><br></div><div>        vector_layer.styleMap = vector_style_map;</div><div><br></div><div>        map.addLayer(vector_layer);</div><div><br></div>-- <br>Thanks,<br>Leon Dmello. <br>(+91) 779 832 8248<br>
<br><br>
</div></div>