diff --git a/src/ol/format/geojsonformat.js b/src/ol/format/geojsonformat.js index f4c3e1fe67..9b12d76095 100644 --- a/src/ol/format/geojsonformat.js +++ b/src/ol/format/geojsonformat.js @@ -398,7 +398,7 @@ ol.format.GeoJSON.prototype.readFeaturesFromObject = function( object, opt_options) { var geoJSONObject = /** @type {GeoJSONObject} */ (object); if (geoJSONObject.type == 'Feature') { - return [this.readFeatureFromObject(object)]; + return [this.readFeatureFromObject(object, opt_options)]; } else if (geoJSONObject.type == 'FeatureCollection') { var geoJSONFeatureCollection = /** @type {GeoJSONFeatureCollection} */ (object); diff --git a/test/spec/ol/format/geojsonformat.test.js b/test/spec/ol/format/geojsonformat.test.js index 0ab714bd47..2c6b220ff5 100644 --- a/test/spec/ol/format/geojsonformat.test.js +++ b/test/spec/ol/format/geojsonformat.test.js @@ -174,6 +174,15 @@ describe('ol.format.GeoJSON', function() { expect(features[2].getGeometry()).to.be.an(ol.geom.Polygon); }); + it('can read and transform a point', function() { + var feature = format.readFeatures(pointGeoJSON, { + featureProjection: 'EPSG:3857' + }); + expect(feature[0].getGeometry()).to.be.an(ol.geom.Point); + expect(feature[0].getGeometry().getCoordinates()).to.eql( + ol.proj.transform([102.0, 0.5], 'EPSG:4326', 'EPSG:3857')); + }); + it('can read and transform a feature collection', function() { var features = format.readFeatures(featureCollectionGeoJSON, { featureProjection: 'EPSG:3857'