diff --git a/externs/geojson.js b/externs/geojson.js index db7e1b62e3..0b7c2c74ac 100644 --- a/externs/geojson.js +++ b/externs/geojson.js @@ -13,6 +13,12 @@ var GeoJSONObject = function() {}; +/** + * @type {!Array.|undefined} + */ +GeoJSONObject.prototype.bbox; + + /** * @type {string} */ @@ -28,11 +34,17 @@ GeoJSONObject.prototype.crs; /** * @constructor - * @extends {GeoJSONObject} */ var GeoJSONCRS = function() {}; +/** + * CRS type. One of `link` or `name`. + * @type {string} + */ +GeoJSONCRS.prototype.type; + + /** * TODO: remove GeoJSONCRSCode when http://jira.codehaus.org/browse/GEOS-5996 * is fixed and widely deployed. @@ -110,12 +122,6 @@ GeoJSONGeometryCollection.prototype.geometries; var GeoJSONFeature = function() {}; -/** - * @type {!Array.|undefined} - */ -GeoJSONFeature.prototype.bbox; - - /** * @type {GeoJSONGeometry} */ @@ -148,16 +154,9 @@ var GeoJSONFeatureCollection = function() {}; GeoJSONFeatureCollection.prototype.features; -/** - * @type {!Array.|undefined} - */ -GeoJSONFeatureCollection.prototype.bbox; - - /** * @constructor - * @extends {GeoJSONObject} */ var GeoJSONLink = function() {}; @@ -166,3 +165,8 @@ var GeoJSONLink = function() {}; * @type {string} */ GeoJSONLink.prototype.href; + +/** + * @type {string} + */ +GeoJSONLink.prototype.type; diff --git a/externs/olx.js b/externs/olx.js index 656a33e25f..ddb1b0cd29 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -3602,7 +3602,7 @@ olx.source.FormatVectorOptions.prototype.projection; * @typedef {{attributions: (Array.|undefined), * defaultProjection: ol.proj.ProjectionLike, * logo: (string|olx.LogoOptions|undefined), - * object: (GeoJSONObject|undefined), + * object: (GeoJSONFeature|GeoJSONFeatureCollection|undefined), * projection: ol.proj.ProjectionLike, * text: (string|undefined), * url: (string|undefined), @@ -3637,8 +3637,8 @@ olx.source.GeoJSONOptions.prototype.logo; /** - * Object. - * @type {GeoJSONObject|undefined} + * GeoJSON feature or feature collection. + * @type {GeoJSONFeature|GeoJSONFeatureCollection|undefined} * @api */ olx.source.GeoJSONOptions.prototype.object; diff --git a/src/ol/format/geojsonformat.js b/src/ol/format/geojsonformat.js index 66fe0b0aff..c29a15b7f2 100644 --- a/src/ol/format/geojsonformat.js +++ b/src/ol/format/geojsonformat.js @@ -64,7 +64,7 @@ ol.format.GeoJSON.EXTENSIONS_ = ['.geojson']; /** - * @param {GeoJSONObject} object Object. + * @param {GeoJSONGeometry|GeoJSONGeometryCollection} object Object. * @param {olx.format.ReadOptions=} opt_options Read options. * @private * @return {ol.geom.Geometry} Geometry. @@ -92,7 +92,7 @@ ol.format.GeoJSON.readGeometryCollectionGeometry_ = function( goog.asserts.assert(object.type == 'GeometryCollection'); var geometries = goog.array.map(object.geometries, /** - * @param {GeoJSONObject} geometry Geometry. + * @param {GeoJSONGeometry} geometry Geometry. * @return {ol.geom.Geometry} geometry Geometry. */ function(geometry) {