Use Array<Foo> instead of Array.<Foo>
This commit is contained in:
@@ -32,7 +32,7 @@ import {get as getProjection} from '../proj.js';
|
||||
* ```
|
||||
* will result in features that have a property `'layer'` set to `'example'`.
|
||||
* When not set, no property will be added to features.
|
||||
* @property {Array.<string>} [layers] Names of the TopoJSON topology's
|
||||
* @property {Array<string>} [layers] Names of the TopoJSON topology's
|
||||
* `objects`'s children to read features from. If not provided, features will
|
||||
* be read from all children.
|
||||
*/
|
||||
@@ -62,7 +62,7 @@ class TopoJSON extends JSONFeature {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Array.<string>}
|
||||
* @type {Array<string>}
|
||||
*/
|
||||
this.layers_ = options.layers ? options.layers : null;
|
||||
|
||||
@@ -91,7 +91,7 @@ class TopoJSON extends JSONFeature {
|
||||
if (transform) {
|
||||
transformArcs(arcs, scale, translate);
|
||||
}
|
||||
/** @type {Array.<module:ol/Feature>} */
|
||||
/** @type {Array<module:ol/Feature>} */
|
||||
const features = [];
|
||||
const topoJSONFeatures = topoJSONTopology.objects;
|
||||
const property = this.layerName_;
|
||||
@@ -171,14 +171,14 @@ const GEOMETRY_READERS = {
|
||||
|
||||
/**
|
||||
* Concatenate arcs into a coordinate array.
|
||||
* @param {Array.<number>} indices Indices of arcs to concatenate. Negative
|
||||
* @param {Array<number>} indices Indices of arcs to concatenate. Negative
|
||||
* values indicate arcs need to be reversed.
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs (already
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs (already
|
||||
* transformed).
|
||||
* @return {Array.<module:ol/coordinate~Coordinate>} Coordinates array.
|
||||
* @return {Array<module:ol/coordinate~Coordinate>} Coordinates array.
|
||||
*/
|
||||
function concatenateArcs(indices, arcs) {
|
||||
/** @type {Array.<module:ol/coordinate~Coordinate>} */
|
||||
/** @type {Array<module:ol/coordinate~Coordinate>} */
|
||||
const coordinates = [];
|
||||
let index, arc;
|
||||
for (let i = 0, ii = indices.length; i < ii; ++i) {
|
||||
@@ -208,8 +208,8 @@ function concatenateArcs(indices, arcs) {
|
||||
* Create a point from a TopoJSON geometry object.
|
||||
*
|
||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||
* @param {Array.<number>} scale Scale for each dimension.
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
* @return {module:ol/geom/Point} Geometry.
|
||||
*/
|
||||
function readPointGeometry(object, scale, translate) {
|
||||
@@ -225,8 +225,8 @@ function readPointGeometry(object, scale, translate) {
|
||||
* Create a multi-point from a TopoJSON geometry object.
|
||||
*
|
||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||
* @param {Array.<number>} scale Scale for each dimension.
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
* @return {module:ol/geom/MultiPoint} Geometry.
|
||||
*/
|
||||
function readMultiPointGeometry(object, scale, translate) {
|
||||
@@ -244,7 +244,7 @@ function readMultiPointGeometry(object, scale, translate) {
|
||||
* Create a linestring from a TopoJSON geometry object.
|
||||
*
|
||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @return {module:ol/geom/LineString} Geometry.
|
||||
*/
|
||||
function readLineStringGeometry(object, arcs) {
|
||||
@@ -257,7 +257,7 @@ function readLineStringGeometry(object, arcs) {
|
||||
* Create a multi-linestring from a TopoJSON geometry object.
|
||||
*
|
||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @return {module:ol/geom/MultiLineString} Geometry.
|
||||
*/
|
||||
function readMultiLineStringGeometry(object, arcs) {
|
||||
@@ -273,7 +273,7 @@ function readMultiLineStringGeometry(object, arcs) {
|
||||
* Create a polygon from a TopoJSON geometry object.
|
||||
*
|
||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @return {module:ol/geom/Polygon} Geometry.
|
||||
*/
|
||||
function readPolygonGeometry(object, arcs) {
|
||||
@@ -289,7 +289,7 @@ function readPolygonGeometry(object, arcs) {
|
||||
* Create a multi-polygon from a TopoJSON geometry object.
|
||||
*
|
||||
* @param {TopoJSONGeometry} object TopoJSON object.
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @return {module:ol/geom/MultiPolygon} Geometry.
|
||||
*/
|
||||
function readMultiPolygonGeometry(object, arcs) {
|
||||
@@ -313,14 +313,14 @@ function readMultiPolygonGeometry(object, arcs) {
|
||||
*
|
||||
* @param {TopoJSONGeometryCollection} collection TopoJSON Geometry
|
||||
* object.
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array.<number>} scale Scale for each dimension.
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
* @param {string|undefined} property Property to set the `GeometryCollection`'s parent
|
||||
* object to.
|
||||
* @param {string} name Name of the `Topology`'s child object.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {Array.<module:ol/Feature>} Array of features.
|
||||
* @return {Array<module:ol/Feature>} Array of features.
|
||||
*/
|
||||
function readFeaturesFromGeometryCollection(collection, arcs, scale, translate, property, name, opt_options) {
|
||||
const geometries = collection.geometries;
|
||||
@@ -337,9 +337,9 @@ function readFeaturesFromGeometryCollection(collection, arcs, scale, translate,
|
||||
* Create a feature from a TopoJSON geometry object.
|
||||
*
|
||||
* @param {TopoJSONGeometry} object TopoJSON geometry object.
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array.<number>} scale Scale for each dimension.
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
* @param {string|undefined} property Property to set the `GeometryCollection`'s parent
|
||||
* object to.
|
||||
* @param {string} name Name of the `Topology`'s child object.
|
||||
@@ -379,9 +379,9 @@ function readFeatureFromGeometry(object, arcs, scale, translate, property, name,
|
||||
* Apply a linear transform to array of arcs. The provided array of arcs is
|
||||
* modified in place.
|
||||
*
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array.<number>} scale Scale for each dimension.
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @param {Array<Array<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
*/
|
||||
function transformArcs(arcs, scale, translate) {
|
||||
for (let i = 0, ii = arcs.length; i < ii; ++i) {
|
||||
@@ -393,9 +393,9 @@ function transformArcs(arcs, scale, translate) {
|
||||
/**
|
||||
* Apply a linear transform to an arc. The provided arc is modified in place.
|
||||
*
|
||||
* @param {Array.<module:ol/coordinate~Coordinate>} arc Arc.
|
||||
* @param {Array.<number>} scale Scale for each dimension.
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @param {Array<module:ol/coordinate~Coordinate>} arc Arc.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
*/
|
||||
function transformArc(arc, scale, translate) {
|
||||
let x = 0;
|
||||
@@ -416,8 +416,8 @@ function transformArc(arc, scale, translate) {
|
||||
* place.
|
||||
*
|
||||
* @param {module:ol/coordinate~Coordinate} vertex Vertex.
|
||||
* @param {Array.<number>} scale Scale for each dimension.
|
||||
* @param {Array.<number>} translate Translation for each dimension.
|
||||
* @param {Array<number>} scale Scale for each dimension.
|
||||
* @param {Array<number>} translate Translation for each dimension.
|
||||
*/
|
||||
function transformVertex(vertex, scale, translate) {
|
||||
vertex[0] = vertex[0] * scale[0] + translate[0];
|
||||
|
||||
Reference in New Issue
Block a user