Module types for ol/geom
This commit is contained in:
@@ -223,7 +223,7 @@ const Parser = function(lexer) {
|
||||
this.token_;
|
||||
|
||||
/**
|
||||
* @type {ol.geom.GeometryLayout}
|
||||
* @type {module:ol/geom/GeometryLayout~GeometryLayout}
|
||||
* @private
|
||||
*/
|
||||
this.layout_ = GeometryLayout.XY;
|
||||
@@ -265,7 +265,7 @@ Parser.prototype.match = function(type) {
|
||||
|
||||
/**
|
||||
* Try to parse the tokens provided by the lexer.
|
||||
* @return {ol.geom.Geometry} The geometry.
|
||||
* @return {module:ol/geom/Geometry~Geometry} The geometry.
|
||||
*/
|
||||
Parser.prototype.parse = function() {
|
||||
this.consume_();
|
||||
@@ -276,7 +276,7 @@ Parser.prototype.parse = function() {
|
||||
|
||||
/**
|
||||
* Try to parse the dimensional info.
|
||||
* @return {ol.geom.GeometryLayout} The layout.
|
||||
* @return {module:ol/geom/GeometryLayout~GeometryLayout} The layout.
|
||||
* @private
|
||||
*/
|
||||
Parser.prototype.parseGeometryLayout_ = function() {
|
||||
@@ -300,7 +300,7 @@ Parser.prototype.parseGeometryLayout_ = function() {
|
||||
|
||||
|
||||
/**
|
||||
* @return {!Array.<ol.geom.Geometry>} A collection of geometries.
|
||||
* @return {!Array.<module:ol/geom/Geometry~Geometry>} A collection of geometries.
|
||||
* @private
|
||||
*/
|
||||
Parser.prototype.parseGeometryCollectionText_ = function() {
|
||||
@@ -556,7 +556,7 @@ inherits(WKT, TextFeature);
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.geom.Point} geom Point geometry.
|
||||
* @param {module:ol/geom/Point~Point} geom Point geometry.
|
||||
* @return {string} Coordinates part of Point as WKT.
|
||||
*/
|
||||
function encodePointGeometry(geom) {
|
||||
@@ -569,7 +569,7 @@ function encodePointGeometry(geom) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.geom.MultiPoint} geom MultiPoint geometry.
|
||||
* @param {module:ol/geom/MultiPoint~MultiPoint} geom MultiPoint geometry.
|
||||
* @return {string} Coordinates part of MultiPoint as WKT.
|
||||
*/
|
||||
function encodeMultiPointGeometry(geom) {
|
||||
@@ -583,7 +583,7 @@ function encodeMultiPointGeometry(geom) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.geom.GeometryCollection} geom GeometryCollection geometry.
|
||||
* @param {module:ol/geom/GeometryCollection~GeometryCollection} geom GeometryCollection geometry.
|
||||
* @return {string} Coordinates part of GeometryCollection as WKT.
|
||||
*/
|
||||
function encodeGeometryCollectionGeometry(geom) {
|
||||
@@ -597,7 +597,7 @@ function encodeGeometryCollectionGeometry(geom) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.geom.LineString|ol.geom.LinearRing} geom LineString geometry.
|
||||
* @param {module:ol/geom/LineString~LineString|module:ol/geom/LinearRing~LinearRing} geom LineString geometry.
|
||||
* @return {string} Coordinates part of LineString as WKT.
|
||||
*/
|
||||
function encodeLineStringGeometry(geom) {
|
||||
@@ -611,7 +611,7 @@ function encodeLineStringGeometry(geom) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.geom.MultiLineString} geom MultiLineString geometry.
|
||||
* @param {module:ol/geom/MultiLineString~MultiLineString} geom MultiLineString geometry.
|
||||
* @return {string} Coordinates part of MultiLineString as WKT.
|
||||
*/
|
||||
function encodeMultiLineStringGeometry(geom) {
|
||||
@@ -625,7 +625,7 @@ function encodeMultiLineStringGeometry(geom) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.geom.Polygon} geom Polygon geometry.
|
||||
* @param {module:ol/geom/Polygon~Polygon} geom Polygon geometry.
|
||||
* @return {string} Coordinates part of Polygon as WKT.
|
||||
*/
|
||||
function encodePolygonGeometry(geom) {
|
||||
@@ -639,7 +639,7 @@ function encodePolygonGeometry(geom) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.geom.MultiPolygon} geom MultiPolygon geometry.
|
||||
* @param {module:ol/geom/MultiPolygon~MultiPolygon} geom MultiPolygon geometry.
|
||||
* @return {string} Coordinates part of MultiPolygon as WKT.
|
||||
*/
|
||||
function encodeMultiPolygonGeometry(geom) {
|
||||
@@ -652,7 +652,7 @@ function encodeMultiPolygonGeometry(geom) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {ol.geom.SimpleGeometry} geom SimpleGeometry geometry.
|
||||
* @param {module:ol/geom/SimpleGeometry~SimpleGeometry} geom SimpleGeometry geometry.
|
||||
* @return {string} Potential dimensional information for WKT type.
|
||||
*/
|
||||
function encodeGeometryLayout(geom) {
|
||||
@@ -670,7 +670,7 @@ function encodeGeometryLayout(geom) {
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {Object.<string, function(ol.geom.Geometry): string>}
|
||||
* @type {Object.<string, function(module:ol/geom/Geometry~Geometry): string>}
|
||||
*/
|
||||
const GeometryEncoder = {
|
||||
'Point': encodePointGeometry,
|
||||
@@ -685,7 +685,7 @@ const GeometryEncoder = {
|
||||
|
||||
/**
|
||||
* Encode a geometry as WKT.
|
||||
* @param {ol.geom.Geometry} geom The geometry to encode.
|
||||
* @param {module:ol/geom/Geometry~Geometry} geom The geometry to encode.
|
||||
* @return {string} WKT string for the geometry.
|
||||
*/
|
||||
function encode(geom) {
|
||||
@@ -709,7 +709,7 @@ function encode(geom) {
|
||||
/**
|
||||
* Parse a WKT string.
|
||||
* @param {string} wkt WKT string.
|
||||
* @return {ol.geom.Geometry|undefined}
|
||||
* @return {module:ol/geom/Geometry~Geometry|undefined}
|
||||
* The geometry created.
|
||||
* @private
|
||||
*/
|
||||
@@ -766,7 +766,7 @@ WKT.prototype.readFeaturesFromText = function(text, opt_options) {
|
||||
const geometry = this.readGeometryFromText(text, opt_options);
|
||||
if (this.splitCollection_ &&
|
||||
geometry.getType() == GeometryType.GEOMETRY_COLLECTION) {
|
||||
geometries = (/** @type {ol.geom.GeometryCollection} */ (geometry))
|
||||
geometries = (/** @type {module:ol/geom/GeometryCollection~GeometryCollection} */ (geometry))
|
||||
.getGeometriesArray();
|
||||
} else {
|
||||
geometries = [geometry];
|
||||
@@ -787,7 +787,7 @@ WKT.prototype.readFeaturesFromText = function(text, opt_options) {
|
||||
* @function
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @param {module:ol/format/Feature~ReadOptions=} opt_options Read options.
|
||||
* @return {ol.geom.Geometry} Geometry.
|
||||
* @return {module:ol/geom/Geometry~Geometry} Geometry.
|
||||
* @api
|
||||
*/
|
||||
WKT.prototype.readGeometry;
|
||||
@@ -799,7 +799,7 @@ WKT.prototype.readGeometry;
|
||||
WKT.prototype.readGeometryFromText = function(text, opt_options) {
|
||||
const geometry = this.parse_(text);
|
||||
if (geometry) {
|
||||
return /** @type {ol.geom.Geometry} */ (transformWithOptions(geometry, false, opt_options));
|
||||
return /** @type {module:ol/geom/Geometry~Geometry} */ (transformWithOptions(geometry, false, opt_options));
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@@ -807,7 +807,7 @@ WKT.prototype.readGeometryFromText = function(text, opt_options) {
|
||||
|
||||
|
||||
/**
|
||||
* @enum {function (new:ol.geom.Geometry, Array, ol.geom.GeometryLayout)}
|
||||
* @enum {function (new:module:ol/geom/Geometry~Geometry, Array, module:ol/geom/GeometryLayout~GeometryLayout)}
|
||||
*/
|
||||
const GeometryConstructor = {
|
||||
'POINT': Point,
|
||||
@@ -833,7 +833,7 @@ const GeometryParser = {
|
||||
|
||||
|
||||
/**
|
||||
* @return {!ol.geom.Geometry} The geometry.
|
||||
* @return {!module:ol/geom/Geometry~Geometry} The geometry.
|
||||
* @private
|
||||
*/
|
||||
Parser.prototype.parseGeometry_ = function() {
|
||||
@@ -914,7 +914,7 @@ WKT.prototype.writeFeaturesText = function(features, opt_options) {
|
||||
* Write a single geometry as a WKT string.
|
||||
*
|
||||
* @function
|
||||
* @param {ol.geom.Geometry} geometry Geometry.
|
||||
* @param {module:ol/geom/Geometry~Geometry} geometry Geometry.
|
||||
* @param {module:ol/format/Feature~WriteOptions=} opt_options Write options.
|
||||
* @return {string} WKT string.
|
||||
* @api
|
||||
@@ -926,7 +926,7 @@ WKT.prototype.writeGeometry;
|
||||
* @inheritDoc
|
||||
*/
|
||||
WKT.prototype.writeGeometryText = function(geometry, opt_options) {
|
||||
return encode(/** @type {ol.geom.Geometry} */ (
|
||||
return encode(/** @type {module:ol/geom/Geometry~Geometry} */ (
|
||||
transformWithOptions(geometry, true, opt_options)));
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user