Allowing for geometries whose bounds cannot be intersected. Thanks for the quick review Andreas. r=ahocevar (closes #1720)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@7957 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2008-09-04 23:12:09 +00:00
parent 4ae2e45083
commit 656a829f82

View File

@@ -165,10 +165,13 @@ OpenLayers.Renderer = OpenLayers.Class({
style = feature.style;
}
if (feature.geometry) {
if (!feature.geometry.getBounds().intersectsBounds(this.extent)) {
style = {display: "none"};
var bounds = feature.geometry.getBounds();
if(bounds) {
if (!bounds.intersectsBounds(this.extent)) {
style = {display: "none"};
}
return this.drawGeometry(feature.geometry, style, feature.id);
}
return this.drawGeometry(feature.geometry, style, feature.id);
}
},