1

Closed

Calling Clustering Code SetData with single point causes error

description

When calling the "SetData" property with a single point, the clustering scripts fails (using the non-mini reference version of V7CientSideClutering.js) at line 173
 
pixel = _map.tryLocationToPixel(_data[i]._LatLong, Microsoft.Maps.PixelReference.control);
 
reason is that the SetData routine at line 326
 
        if (i > 0) {
 
should be
        if (i >= 0) {
 
With the original (if (i > 0)) , a single points count is equal to 0 and thus the _data[i]._LatLong property is not set which is needed for call at line 173.
I've corrected in my version but thought I would pass on my finding.
BTW, thanks for all your work and contributions. The code is awesome and works very well.
Thanks again
David
Closed by

comments

rbrundritt wrote Jun 19, 2012 at 11:29 AM

This was updated in the source code a while ago but it looks like the zip file was never updated. I have updated the zip file. Thanks for reporting.