Adding a check to make sure features have a geometry before entering the cluster algorithm. r=crschmidt (closes #1816)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@8316 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2008-11-10 22:23:17 +00:00
parent 7c0fadd14a
commit e520aea515
2 changed files with 16 additions and 11 deletions
+4 -1
View File
@@ -56,6 +56,9 @@
);
}
// add one additional feature, with no geometry - just to confirm it doesn't break things
features.push(new OpenLayers.Feature.Vector());
map.setCenter(new OpenLayers.LonLat(0, 0), 0);
layer.addFeatures(features);
@@ -63,7 +66,7 @@
// threshold: 4 * 20 = 80 units
// one cluster
t.eq(layer.features.length, 1, "[4] layer has one cluster");
t.ok(featuresEq(layer.features[0].cluster, features), "[4] cluster includes all features");
t.ok(featuresEq(layer.features[0].cluster, features.slice(0, 80)), "[4] cluster includes all features with geometries");
// resolution 2
// threshold: 2 * 20 = 40 units