You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the extent is changed too quickly (i.e., a user zooms in and out rapidly) when there are clusters displayed on the map, an error can sometimes be generated. There does not appear to be any code to check if the features length is undefined.
Unable to get property '0' of undefined or null reference
The error occurs at line 57 in animatedclusterlayer.js section below:
/** @private Get the cluster that contains a feature
*/
ol.layer.AnimatedCluster.prototype.getClusterForFeature = function(f, cluster)
{ for (var j=0, c; c=cluster[j]; j++)
{ var features = cluster[j].get('features');
//if (features.length > 1)
for (var k=0, f2; f2=features[k]; k++) <== Error Here
{ if (f===f2)
{ return cluster[j];
}
}
}
return false;
}
This error can be reproduced under Google Chrome and Internet Explorer.
The text was updated successfully, but these errors were encountered:
The length verification fix above works wonderfully. There is another section of code where this error is now occurring.
Unable to get property '0' of undefined or null reference
The error occurs at line 101 in animatedclusterlayer.js section below:
for (var i=0, c0; c0=a.cA[i]; i++)
{ var f = c0.get('features')[0]; <== Error Here
var c = this.getClusterForFeature (f, a.cB);
if (c) a.clusters.push({ f:c0, pt:c.getGeometry().getCoordinates() });
}
This error can be reproduced under Google Chrome, Firefox 42, and Internet Explorer 11.
Thanks for looking into this issue.
You are welcome! I appreciate all of your hard work. Thank you for sharing your code and expertise with the OL3 community. The last commit solved the problem quite nicely. I will close the issue.
If the extent is changed too quickly (i.e., a user zooms in and out rapidly) when there are clusters displayed on the map, an error can sometimes be generated. There does not appear to be any code to check if the features length is undefined.
The error occurs at line 57 in animatedclusterlayer.js section below:
This error can be reproduced under Google Chrome and Internet Explorer.
The text was updated successfully, but these errors were encountered: