Module types for ol/geom

This commit is contained in:
Tim Schaub
2018-03-11 23:08:50 -06:00
parent 41d9a84a8f
commit ef70d71636
60 changed files with 482 additions and 482 deletions

View File

@@ -81,7 +81,7 @@ inherits(TopoJSON, JSONFeature);
/**
* @const
* @type {Object.<string, function(TopoJSONGeometry, Array, ...Array): ol.geom.Geometry>}
* @type {Object.<string, function(TopoJSONGeometry, Array, ...Array): module:ol/geom/Geometry~Geometry>}
*/
const GEOMETRY_READERS = {
'Point': readPointGeometry,
@@ -134,7 +134,7 @@ function concatenateArcs(indices, arcs) {
* @param {TopoJSONGeometry} object TopoJSON object.
* @param {Array.<number>} scale Scale for each dimension.
* @param {Array.<number>} translate Translation for each dimension.
* @return {ol.geom.Point} Geometry.
* @return {module:ol/geom/Point~Point} Geometry.
*/
function readPointGeometry(object, scale, translate) {
const coordinates = object.coordinates;
@@ -151,7 +151,7 @@ function readPointGeometry(object, scale, translate) {
* @param {TopoJSONGeometry} object TopoJSON object.
* @param {Array.<number>} scale Scale for each dimension.
* @param {Array.<number>} translate Translation for each dimension.
* @return {ol.geom.MultiPoint} Geometry.
* @return {module:ol/geom/MultiPoint~MultiPoint} Geometry.
*/
function readMultiPointGeometry(object, scale, translate) {
const coordinates = object.coordinates;
@@ -169,7 +169,7 @@ function readMultiPointGeometry(object, scale, translate) {
*
* @param {TopoJSONGeometry} object TopoJSON object.
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
* @return {ol.geom.LineString} Geometry.
* @return {module:ol/geom/LineString~LineString} Geometry.
*/
function readLineStringGeometry(object, arcs) {
const coordinates = concatenateArcs(object.arcs, arcs);
@@ -182,7 +182,7 @@ function readLineStringGeometry(object, arcs) {
*
* @param {TopoJSONGeometry} object TopoJSON object.
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
* @return {ol.geom.MultiLineString} Geometry.
* @return {module:ol/geom/MultiLineString~MultiLineString} Geometry.
*/
function readMultiLineStringGeometry(object, arcs) {
const coordinates = [];
@@ -198,7 +198,7 @@ function readMultiLineStringGeometry(object, arcs) {
*
* @param {TopoJSONGeometry} object TopoJSON object.
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
* @return {ol.geom.Polygon} Geometry.
* @return {module:ol/geom/Polygon~Polygon} Geometry.
*/
function readPolygonGeometry(object, arcs) {
const coordinates = [];
@@ -214,7 +214,7 @@ function readPolygonGeometry(object, arcs) {
*
* @param {TopoJSONGeometry} object TopoJSON object.
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} arcs Array of arcs.
* @return {ol.geom.MultiPolygon} Geometry.
* @return {module:ol/geom/MultiPolygon~MultiPolygon} Geometry.
*/
function readMultiPolygonGeometry(object, arcs) {
const coordinates = [];
@@ -280,7 +280,7 @@ function readFeatureFromGeometry(object, arcs, scale, translate, property, name,
geometry = geometryReader(object, arcs);
}
const feature = new Feature();
feature.setGeometry(/** @type {ol.geom.Geometry} */ (
feature.setGeometry(/** @type {module:ol/geom/Geometry~Geometry} */ (
transformWithOptions(geometry, false, opt_options)));
if (object.id !== undefined) {
feature.setId(object.id);