Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'fix-geo-bounds-collection' of https://github.com/natevw/d3

 into 3.0.1
  • Loading branch information...
commit 8b0c10f8e555a5a94f77550de7945bcdd2d229ba 2 parents cd1b2d0 + 1aa5046
@mbostock authored
View
8 d3.js
@@ -5348,10 +5348,6 @@
FeatureCollection: function(object, listener) {
var features = object.features, i = -1, n = features.length;
while (++i < n) d3_geo_streamGeometry(features[i].geometry, listener);
- },
- GeometryCollection: function(object, listener) {
- var geometries = object.geometries, i = -1, n = geometries.length;
- while (++i < n) d3_geo_streamGeometry(geometries[i], listener);
}
};
var d3_geo_streamGeometryType = {
@@ -5379,6 +5375,10 @@
MultiPolygon: function(object, listener) {
var coordinates = object.coordinates, i = -1, n = coordinates.length;
while (++i < n) d3_geo_streamPolygon(coordinates[i], listener);
+ },
+ GeometryCollection: function(object, listener) {
+ var geometries = object.geometries, i = -1, n = geometries.length;
+ while (++i < n) d3_geo_streamGeometry(geometries[i], listener);
}
};
function d3_geo_streamLine(coordinates, listener, closed) {
View
2  d3.min.js
1 addition, 1 deletion not shown
View
8 src/geo/stream.js
@@ -19,10 +19,6 @@ var d3_geo_streamObjectType = {
FeatureCollection: function(object, listener) {
var features = object.features, i = -1, n = features.length;
while (++i < n) d3_geo_streamGeometry(features[i].geometry, listener);
- },
- GeometryCollection: function(object, listener) {
- var geometries = object.geometries, i = -1, n = geometries.length;
- while (++i < n) d3_geo_streamGeometry(geometries[i], listener);
}
};
@@ -51,6 +47,10 @@ var d3_geo_streamGeometryType = {
MultiPolygon: function(object, listener) {
var coordinates = object.coordinates, i = -1, n = coordinates.length;
while (++i < n) d3_geo_streamPolygon(coordinates[i], listener);
+ },
+ GeometryCollection: function(object, listener) {
+ var geometries = object.geometries, i = -1, n = geometries.length;
+ while (++i < n) d3_geo_streamGeometry(geometries[i], listener);
}
};
View
23 test/geo/bounds-test.js
@@ -90,6 +90,29 @@ suite.addBatch({
type: "Polygon",
coordinates: [[[-123, 39], [-122, 39], [-122, 38], [-123, 39]], [[10, 20], [20, 20], [20, 10], [10, 10], [10, 20]]]
}), [[-123, 38], [-122, 39]])
+ },
+ "NestedCollection": function (bounds) {
+ assert.deepEqual(bounds({
+ type: "FeatureCollection",
+ features: [
+ {
+ type: "Feature",
+ geometry: {
+ type: "GeometryCollection",
+ geometries: [
+ {
+ type: "Point",
+ coordinates: [-120,47]
+ },
+ {
+ type: "Point",
+ coordinates: [-119,46]
+ }
+ ]
+ }
+ }
+ ]
+ }), [[-120,46], [-119,47]])
}
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.