Merge pull request #5080 from probins/geomcoll

Fix geojson write GeometryCollection
This commit is contained in:
Andreas Hocevar
2016-03-21 13:28:46 +01:00
2 changed files with 25 additions and 1 deletions

View File

@@ -211,7 +211,9 @@ ol.format.GeoJSON.writeGeometryCollectionGeometry_ = function(
goog.asserts.assertInstanceof(geometry, ol.geom.GeometryCollection,
'geometry should be an ol.geom.GeometryCollection');
var geometries = geometry.getGeometriesArray().map(function(geometry) {
return ol.format.GeoJSON.writeGeometry_(geometry, opt_options);
var options = ol.object.assign({}, opt_options);
delete options.featureProjection;
return ol.format.GeoJSON.writeGeometry_(geometry, options);
});
return /** @type {GeoJSONGeometryCollection} */ ({
type: 'GeometryCollection',