diff --git a/src/ol/coordinate.js b/src/ol/coordinate.js index 60f339e00e..af1e49a457 100644 --- a/src/ol/coordinate.js +++ b/src/ol/coordinate.js @@ -1,4 +1,5 @@ goog.provide('ol.Coordinate'); +goog.provide('ol.CoordinateArray'); goog.provide('ol.CoordinateFormatType'); goog.provide('ol.coordinate'); @@ -18,6 +19,13 @@ ol.CoordinateFormatType; ol.Coordinate; +/** + * An array of coordinate arrays. + * @typedef {Array.} + */ +ol.CoordinateArray; + + /** * @param {ol.Coordinate} coordinate Coordinate. * @param {ol.Coordinate} delta Delta. diff --git a/src/ol/geom/base.js b/src/ol/geom/base.js index a2bd01e309..9a8c8ae45b 100644 --- a/src/ol/geom/base.js +++ b/src/ol/geom/base.js @@ -1,14 +1,6 @@ -goog.provide('ol.geom.VertexArray'); - goog.require('ol.coordinate'); -/** - * @typedef {Array.} - */ -ol.geom.VertexArray; - - /** * Calculate the squared distance from a point to a line segment. * diff --git a/src/ol/geom/linearring.js b/src/ol/geom/linearring.js index 4f08723b99..5fb5e5a3ef 100644 --- a/src/ol/geom/linearring.js +++ b/src/ol/geom/linearring.js @@ -1,16 +1,16 @@ goog.provide('ol.geom.LinearRing'); +goog.require('ol.CoordinateArray'); goog.require('ol.geom.GeometryType'); goog.require('ol.geom.LineString'); goog.require('ol.geom.SharedVertices'); -goog.require('ol.geom.VertexArray'); /** * @constructor * @extends {ol.geom.LineString} - * @param {ol.geom.VertexArray} coordinates Vertex array (e.g. + * @param {ol.CoordinateArray} coordinates Vertex array (e.g. * [[x0, y0], [x1, y1]]). * @param {ol.geom.SharedVertices=} opt_shared Shared vertices. */ @@ -39,7 +39,7 @@ goog.inherits(ol.geom.LinearRing, ol.geom.LineString); * implementation for an example of this. * https://github.com/OSGeo/gdal/blob/trunk/gdal/ogr/ogrlinearring.cpp * - * @param {ol.geom.VertexArray} coordinates Linear ring coordinates. + * @param {ol.CoordinateArray} coordinates Linear ring coordinates. * @return {boolean} The coordinates are in clockwise order. */ ol.geom.LinearRing.isClockwise = function(coordinates) { diff --git a/src/ol/geom/linestring.js b/src/ol/geom/linestring.js index 7a7f2321fd..a44d37e312 100644 --- a/src/ol/geom/linestring.js +++ b/src/ol/geom/linestring.js @@ -1,17 +1,17 @@ goog.provide('ol.geom.LineString'); goog.require('goog.asserts'); +goog.require('ol.CoordinateArray'); goog.require('ol.geom.Geometry'); goog.require('ol.geom.GeometryType'); goog.require('ol.geom.SharedVertices'); -goog.require('ol.geom.VertexArray'); /** * @constructor * @extends {ol.geom.Geometry} - * @param {ol.geom.VertexArray} coordinates Vertex array (e.g. + * @param {ol.CoordinateArray} coordinates Vertex array (e.g. * [[x0, y0], [x1, y1]]). * @param {ol.geom.SharedVertices=} opt_shared Shared vertices. */ @@ -67,7 +67,7 @@ ol.geom.LineString.prototype.get = function(index, dim) { /** * @inheritDoc - * @return {ol.geom.VertexArray} Coordinates array. + * @return {ol.CoordinateArray} Coordinates array. */ ol.geom.LineString.prototype.getCoordinates = function() { var count = this.getCount(); diff --git a/src/ol/geom/multilinestring.js b/src/ol/geom/multilinestring.js index b656648992..a884e7411b 100644 --- a/src/ol/geom/multilinestring.js +++ b/src/ol/geom/multilinestring.js @@ -1,18 +1,18 @@ goog.provide('ol.geom.MultiLineString'); goog.require('goog.asserts'); +goog.require('ol.CoordinateArray'); goog.require('ol.geom.AbstractCollection'); goog.require('ol.geom.GeometryType'); goog.require('ol.geom.LineString'); goog.require('ol.geom.SharedVertices'); -goog.require('ol.geom.VertexArray'); /** * @constructor * @extends {ol.geom.AbstractCollection} - * @param {Array.} coordinates Coordinates array. + * @param {Array.} coordinates Coordinates array. * @param {ol.geom.SharedVertices=} opt_shared Shared vertices. */ ol.geom.MultiLineString = function(coordinates, opt_shared) { diff --git a/src/ol/geom/multipoint.js b/src/ol/geom/multipoint.js index 43c475bfeb..ce9e0c100e 100644 --- a/src/ol/geom/multipoint.js +++ b/src/ol/geom/multipoint.js @@ -1,18 +1,18 @@ goog.provide('ol.geom.MultiPoint'); goog.require('goog.asserts'); +goog.require('ol.CoordinateArray'); goog.require('ol.geom.AbstractCollection'); goog.require('ol.geom.GeometryType'); goog.require('ol.geom.Point'); goog.require('ol.geom.SharedVertices'); -goog.require('ol.geom.VertexArray'); /** * @constructor * @extends {ol.geom.AbstractCollection} - * @param {ol.geom.VertexArray} coordinates Coordinates array. + * @param {ol.CoordinateArray} coordinates Coordinates array. * @param {ol.geom.SharedVertices=} opt_shared Shared vertices. */ ol.geom.MultiPoint = function(coordinates, opt_shared) { diff --git a/src/ol/geom/multipolygon.js b/src/ol/geom/multipolygon.js index 452f487386..be355cfd65 100644 --- a/src/ol/geom/multipolygon.js +++ b/src/ol/geom/multipolygon.js @@ -1,18 +1,18 @@ goog.provide('ol.geom.MultiPolygon'); goog.require('goog.asserts'); +goog.require('ol.CoordinateArray'); goog.require('ol.geom.AbstractCollection'); goog.require('ol.geom.GeometryType'); goog.require('ol.geom.Polygon'); goog.require('ol.geom.SharedVertices'); -goog.require('ol.geom.VertexArray'); /** * @constructor * @extends {ol.geom.AbstractCollection} - * @param {Array.>} coordinates Coordinates + * @param {Array.>} coordinates Coordinates * array. * @param {ol.geom.SharedVertices=} opt_shared Shared vertices. */ diff --git a/src/ol/geom/polygon.js b/src/ol/geom/polygon.js index 77df7e0259..2f442a56e4 100644 --- a/src/ol/geom/polygon.js +++ b/src/ol/geom/polygon.js @@ -1,12 +1,12 @@ goog.provide('ol.geom.Polygon'); goog.require('goog.asserts'); +goog.require('ol.CoordinateArray'); goog.require('ol.extent'); goog.require('ol.geom.Geometry'); goog.require('ol.geom.GeometryType'); goog.require('ol.geom.LinearRing'); goog.require('ol.geom.SharedVertices'); -goog.require('ol.geom.VertexArray'); @@ -19,7 +19,7 @@ goog.require('ol.geom.VertexArray'); * * @constructor * @extends {ol.geom.Geometry} - * @param {Array.} coordinates Array of rings. First + * @param {Array.} coordinates Array of rings. First * is outer, any remaining are inner. * @param {ol.geom.SharedVertices=} opt_shared Shared vertices. */ @@ -89,7 +89,7 @@ ol.geom.Polygon.prototype.getBounds = function() { /** - * @return {Array.} Coordinates array. + * @return {Array.} Coordinates array. */ ol.geom.Polygon.prototype.getCoordinates = function() { var count = this.rings.length; diff --git a/src/ol/geom/sharedvertices.js b/src/ol/geom/sharedvertices.js index 0a2decfdd5..e6c432997b 100644 --- a/src/ol/geom/sharedvertices.js +++ b/src/ol/geom/sharedvertices.js @@ -2,7 +2,7 @@ goog.provide('ol.geom.SharedVertices'); goog.require('goog.asserts'); goog.require('ol.Coordinate'); -goog.require('ol.geom.VertexArray'); +goog.require('ol.CoordinateArray'); /** @@ -60,7 +60,7 @@ ol.geom.SharedVertices = function(opt_options) { /** * Adds a vertex array to the shared coordinate array. - * @param {ol.geom.VertexArray} vertices Array of vertices. + * @param {ol.CoordinateArray} vertices Array of vertices. * @return {number} Index used to reference the added vertex array. */ ol.geom.SharedVertices.prototype.add = function(vertices) { diff --git a/src/ol/parser/topojson.js b/src/ol/parser/topojson.js index 02c9419b8b..b17badf7b1 100644 --- a/src/ol/parser/topojson.js +++ b/src/ol/parser/topojson.js @@ -1,6 +1,7 @@ goog.provide('ol.parser.TopoJSON'); goog.require('ol.Coordinate'); +goog.require('ol.CoordinateArray'); goog.require('ol.Feature'); goog.require('ol.geom.GeometryType'); goog.require('ol.geom.LineString'); @@ -9,7 +10,6 @@ goog.require('ol.geom.MultiPoint'); goog.require('ol.geom.MultiPolygon'); goog.require('ol.geom.Point'); goog.require('ol.geom.Polygon'); -goog.require('ol.geom.VertexArray'); goog.require('ol.parser.Parser'); goog.require('ol.parser.ReadFeaturesOptions'); goog.require('ol.parser.StringFeatureParser'); @@ -41,8 +41,8 @@ goog.addSingletonGetter(ol.parser.TopoJSON); * Concatenate arcs into a coordinate array. * @param {Array.} indices Indices of arcs to concatenate. Negative * values indicate arcs need to be reversed. - * @param {Array.} arcs Arcs (already transformed). - * @return {ol.geom.VertexArray} Coordinate array. + * @param {Array.} arcs Arcs (already transformed). + * @return {ol.CoordinateArray} Coordinate array. * @private */ ol.parser.TopoJSON.prototype.concatenateArcs_ = function(indices, arcs) { @@ -117,7 +117,7 @@ ol.parser.TopoJSON.prototype.readFeaturesFromObject = * Create a feature from a TopoJSON geometry object. * * @param {TopoJSONGeometry} object TopoJSON geometry object. - * @param {Array.} arcs Array of arcs. + * @param {Array.} arcs Array of arcs. * @param {Array.} scale Scale for each dimension. * @param {Array.} translate Translation for each dimension. * @param {ol.parser.ReadFeaturesOptions=} opt_options Reader options. @@ -163,7 +163,7 @@ ol.parser.TopoJSON.prototype.readFeatureFromGeometry_ = function(object, arcs, * * @param {TopoJSONGeometryCollection} collection TopoJSON GeometryCollection * object. - * @param {Array.} arcs Array of arcs. + * @param {Array.} arcs Array of arcs. * @param {Array.} scale Scale for each dimension. * @param {Array.} translate Translation for each dimension. * @param {ol.parser.ReadFeaturesOptions=} opt_options Reader options. @@ -217,7 +217,7 @@ ol.parser.TopoJSON.prototype.readFeaturesFromTopology_ = function( * Create a linestring from a TopoJSON geometry object. * * @param {TopoJSONLineString} object TopoJSON object. - * @param {Array.} arcs Array of arcs. + * @param {Array.} arcs Array of arcs. * @param {ol.parser.ReadFeaturesOptions=} opt_options Reader options. * @return {ol.geom.LineString} Geometry. * @private @@ -239,7 +239,7 @@ ol.parser.TopoJSON.prototype.readLineString_ = function(object, arcs, * Create a multi-linestring from a TopoJSON geometry object. * * @param {TopoJSONMultiLineString} object TopoJSON object. - * @param {Array.} arcs Array of arcs. + * @param {Array.} arcs Array of arcs. * @param {ol.parser.ReadFeaturesOptions=} opt_options Reader options. * @return {ol.geom.MultiLineString} Geometry. * @private @@ -293,7 +293,7 @@ ol.parser.TopoJSON.prototype.readMultiPoint_ = function(object, scale, * Create a multi-polygon from a TopoJSON geometry object. * * @param {TopoJSONMultiPolygon} object TopoJSON object. - * @param {Array.} arcs Array of arcs. + * @param {Array.} arcs Array of arcs. * @param {ol.parser.ReadFeaturesOptions=} opt_options Reader options. * @return {ol.geom.MultiPolygon} Geometry. * @private @@ -353,7 +353,7 @@ ol.parser.TopoJSON.prototype.readPoint_ = function(object, scale, translate, * Create a polygon from a TopoJSON geometry object. * * @param {TopoJSONPolygon} object TopoJSON object. - * @param {Array.} arcs Array of arcs. + * @param {Array.} arcs Array of arcs. * @param {ol.parser.ReadFeaturesOptions=} opt_options Reader options. * @return {ol.geom.Polygon} Geometry. * @private @@ -380,7 +380,7 @@ ol.parser.TopoJSON.prototype.readPolygon_ = function(object, arcs, * Apply a linear transform to array of arcs. The provided array of arcs is * modified in place. * - * @param {Array.} arcs Array of arcs. + * @param {Array.} arcs Array of arcs. * @param {Array.} scale Scale for each dimension. * @param {Array.} translate Translation for each dimension. * @private @@ -395,7 +395,7 @@ ol.parser.TopoJSON.prototype.transformArcs_ = function(arcs, scale, translate) { /** * Apply a linear transform to an arc. The provided arc is modified in place. * - * @param {ol.geom.VertexArray} arc Arc. + * @param {ol.CoordinateArray} arc Arc. * @param {Array.} scale Scale for each dimension. * @param {Array.} translate Translation for each dimension. * @private