Get rid of olx.js and typedef.js typedefs for ol
This commit is contained in:
206
src/ol/extent.js
206
src/ol/extent.js
@@ -6,11 +6,17 @@ import Corner from './extent/Corner.js';
|
||||
import Relationship from './extent/Relationship.js';
|
||||
|
||||
|
||||
/**
|
||||
* An array of numbers representing an extent: `[minx, miny, maxx, maxy]`.
|
||||
* @typedef {Array.<number>} Extent
|
||||
* @api
|
||||
*/
|
||||
|
||||
/**
|
||||
* Build an extent that includes all given coordinates.
|
||||
*
|
||||
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
|
||||
* @return {ol.Extent} Bounding extent.
|
||||
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @return {module:ol/extent~Extent} Bounding extent.
|
||||
* @api
|
||||
*/
|
||||
export function boundingExtent(coordinates) {
|
||||
@@ -25,9 +31,9 @@ export function boundingExtent(coordinates) {
|
||||
/**
|
||||
* @param {Array.<number>} xs Xs.
|
||||
* @param {Array.<number>} ys Ys.
|
||||
* @param {ol.Extent=} opt_extent Destination extent.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Destination extent.
|
||||
* @private
|
||||
* @return {ol.Extent} Extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
*/
|
||||
function _boundingExtentXYs(xs, ys, opt_extent) {
|
||||
const minX = Math.min.apply(null, xs);
|
||||
@@ -40,10 +46,10 @@ function _boundingExtentXYs(xs, ys, opt_extent) {
|
||||
|
||||
/**
|
||||
* Return extent increased by the provided value.
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {number} value The amount by which the extent should be buffered.
|
||||
* @param {ol.Extent=} opt_extent Extent.
|
||||
* @return {ol.Extent} Extent.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
* @api
|
||||
*/
|
||||
export function buffer(extent, value, opt_extent) {
|
||||
@@ -67,9 +73,9 @@ export function buffer(extent, value, opt_extent) {
|
||||
/**
|
||||
* Creates a clone of an extent.
|
||||
*
|
||||
* @param {ol.Extent} extent Extent to clone.
|
||||
* @param {ol.Extent=} opt_extent Extent.
|
||||
* @return {ol.Extent} The clone.
|
||||
* @param {module:ol/extent~Extent} extent Extent to clone.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||
* @return {module:ol/extent~Extent} The clone.
|
||||
*/
|
||||
export function clone(extent, opt_extent) {
|
||||
if (opt_extent) {
|
||||
@@ -85,7 +91,7 @@ export function clone(extent, opt_extent) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {number} x X.
|
||||
* @param {number} y Y.
|
||||
* @return {number} Closest squared distance.
|
||||
@@ -113,8 +119,8 @@ export function closestSquaredDistanceXY(extent, x, y) {
|
||||
/**
|
||||
* Check if the passed coordinate is contained or on the edge of the extent.
|
||||
*
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {ol.Coordinate} coordinate Coordinate.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||
* @return {boolean} The coordinate is contained in the extent.
|
||||
* @api
|
||||
*/
|
||||
@@ -129,8 +135,8 @@ export function containsCoordinate(extent, coordinate) {
|
||||
* An extent is deemed contained if it lies completely within the other extent,
|
||||
* including if they share one or more edges.
|
||||
*
|
||||
* @param {ol.Extent} extent1 Extent 1.
|
||||
* @param {ol.Extent} extent2 Extent 2.
|
||||
* @param {module:ol/extent~Extent} extent1 Extent 1.
|
||||
* @param {module:ol/extent~Extent} extent2 Extent 2.
|
||||
* @return {boolean} The second extent is contained by or on the edge of the
|
||||
* first.
|
||||
* @api
|
||||
@@ -144,7 +150,7 @@ export function containsExtent(extent1, extent2) {
|
||||
/**
|
||||
* Check if the passed coordinate is contained or on the edge of the extent.
|
||||
*
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {number} x X coordinate.
|
||||
* @param {number} y Y coordinate.
|
||||
* @return {boolean} The x, y values are contained in the extent.
|
||||
@@ -157,10 +163,10 @@ export function containsXY(extent, x, y) {
|
||||
|
||||
/**
|
||||
* Get the relationship between a coordinate and extent.
|
||||
* @param {ol.Extent} extent The extent.
|
||||
* @param {ol.Coordinate} coordinate The coordinate.
|
||||
* @param {module:ol/extent~Extent} extent The extent.
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate The coordinate.
|
||||
* @return {number} The relationship (bitwise compare with
|
||||
* ol.extent.Relationship).
|
||||
* module:ol/extent~Extent.Relationship).
|
||||
*/
|
||||
export function coordinateRelationship(extent, coordinate) {
|
||||
const minX = extent[0];
|
||||
@@ -189,7 +195,7 @@ export function coordinateRelationship(extent, coordinate) {
|
||||
|
||||
/**
|
||||
* Create an empty extent.
|
||||
* @return {ol.Extent} Empty extent.
|
||||
* @return {module:ol/extent~Extent} Empty extent.
|
||||
* @api
|
||||
*/
|
||||
export function createEmpty() {
|
||||
@@ -203,8 +209,8 @@ export function createEmpty() {
|
||||
* @param {number} minY Minimum Y.
|
||||
* @param {number} maxX Maximum X.
|
||||
* @param {number} maxY Maximum Y.
|
||||
* @param {ol.Extent=} opt_extent Destination extent.
|
||||
* @return {ol.Extent} Extent.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Destination extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
*/
|
||||
export function createOrUpdate(minX, minY, maxX, maxY, opt_extent) {
|
||||
if (opt_extent) {
|
||||
@@ -221,8 +227,8 @@ export function createOrUpdate(minX, minY, maxX, maxY, opt_extent) {
|
||||
|
||||
/**
|
||||
* Create a new empty extent or make the provided one empty.
|
||||
* @param {ol.Extent=} opt_extent Extent.
|
||||
* @return {ol.Extent} Extent.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
*/
|
||||
export function createOrUpdateEmpty(opt_extent) {
|
||||
return createOrUpdate(
|
||||
@@ -231,9 +237,9 @@ export function createOrUpdateEmpty(opt_extent) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Coordinate} coordinate Coordinate.
|
||||
* @param {ol.Extent=} opt_extent Extent.
|
||||
* @return {ol.Extent} Extent.
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
*/
|
||||
export function createOrUpdateFromCoordinate(coordinate, opt_extent) {
|
||||
const x = coordinate[0];
|
||||
@@ -243,9 +249,9 @@ export function createOrUpdateFromCoordinate(coordinate, opt_extent) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
|
||||
* @param {ol.Extent=} opt_extent Extent.
|
||||
* @return {ol.Extent} Extent.
|
||||
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
*/
|
||||
export function createOrUpdateFromCoordinates(coordinates, opt_extent) {
|
||||
const extent = createOrUpdateEmpty(opt_extent);
|
||||
@@ -258,8 +264,8 @@ export function createOrUpdateFromCoordinates(coordinates, opt_extent) {
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
* @param {ol.Extent=} opt_extent Extent.
|
||||
* @return {ol.Extent} Extent.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
*/
|
||||
export function createOrUpdateFromFlatCoordinates(flatCoordinates, offset, end, stride, opt_extent) {
|
||||
const extent = createOrUpdateEmpty(opt_extent);
|
||||
@@ -267,9 +273,9 @@ export function createOrUpdateFromFlatCoordinates(flatCoordinates, offset, end,
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {Array.<Array.<ol.Coordinate>>} rings Rings.
|
||||
* @param {ol.Extent=} opt_extent Extent.
|
||||
* @return {ol.Extent} Extent.
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} rings Rings.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
*/
|
||||
export function createOrUpdateFromRings(rings, opt_extent) {
|
||||
const extent = createOrUpdateEmpty(opt_extent);
|
||||
@@ -279,8 +285,8 @@ export function createOrUpdateFromRings(rings, opt_extent) {
|
||||
|
||||
/**
|
||||
* Determine if two extents are equivalent.
|
||||
* @param {ol.Extent} extent1 Extent 1.
|
||||
* @param {ol.Extent} extent2 Extent 2.
|
||||
* @param {module:ol/extent~Extent} extent1 Extent 1.
|
||||
* @param {module:ol/extent~Extent} extent2 Extent 2.
|
||||
* @return {boolean} The two extents are equivalent.
|
||||
* @api
|
||||
*/
|
||||
@@ -292,9 +298,9 @@ export function equals(extent1, extent2) {
|
||||
|
||||
/**
|
||||
* Modify an extent to include another extent.
|
||||
* @param {ol.Extent} extent1 The extent to be modified.
|
||||
* @param {ol.Extent} extent2 The extent that will be included in the first.
|
||||
* @return {ol.Extent} A reference to the first (extended) extent.
|
||||
* @param {module:ol/extent~Extent} extent1 The extent to be modified.
|
||||
* @param {module:ol/extent~Extent} extent2 The extent that will be included in the first.
|
||||
* @return {module:ol/extent~Extent} A reference to the first (extended) extent.
|
||||
* @api
|
||||
*/
|
||||
export function extend(extent1, extent2) {
|
||||
@@ -315,8 +321,8 @@ export function extend(extent1, extent2) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {ol.Coordinate} coordinate Coordinate.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate Coordinate.
|
||||
*/
|
||||
export function extendCoordinate(extent, coordinate) {
|
||||
if (coordinate[0] < extent[0]) {
|
||||
@@ -335,9 +341,9 @@ export function extendCoordinate(extent, coordinate) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {Array.<ol.Coordinate>} coordinates Coordinates.
|
||||
* @return {ol.Extent} Extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Array.<module:ol/coordinate~Coordinate>} coordinates Coordinates.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
*/
|
||||
export function extendCoordinates(extent, coordinates) {
|
||||
for (let i = 0, ii = coordinates.length; i < ii; ++i) {
|
||||
@@ -348,12 +354,12 @@ export function extendCoordinates(extent, coordinates) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Array.<number>} flatCoordinates Flat coordinates.
|
||||
* @param {number} offset Offset.
|
||||
* @param {number} end End.
|
||||
* @param {number} stride Stride.
|
||||
* @return {ol.Extent} Extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
*/
|
||||
export function extendFlatCoordinates(extent, flatCoordinates, offset, end, stride) {
|
||||
for (; offset < end; offset += stride) {
|
||||
@@ -364,9 +370,9 @@ export function extendFlatCoordinates(extent, flatCoordinates, offset, end, stri
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {Array.<Array.<ol.Coordinate>>} rings Rings.
|
||||
* @return {ol.Extent} Extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {Array.<Array.<module:ol/coordinate~Coordinate>>} rings Rings.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
*/
|
||||
export function extendRings(extent, rings) {
|
||||
for (let i = 0, ii = rings.length; i < ii; ++i) {
|
||||
@@ -377,7 +383,7 @@ export function extendRings(extent, rings) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {number} x X.
|
||||
* @param {number} y Y.
|
||||
*/
|
||||
@@ -393,8 +399,8 @@ export function extendXY(extent, x, y) {
|
||||
* This function calls `callback` for each corner of the extent. If the
|
||||
* callback returns a truthy value the function returns that value
|
||||
* immediately. Otherwise the function returns `false`.
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {function(this:T, ol.Coordinate): S} callback Callback.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {function(this:T, module:ol/coordinate~Coordinate): S} callback Callback.
|
||||
* @param {T=} opt_this Value to use as `this` when executing `callback`.
|
||||
* @return {S|boolean} Value.
|
||||
* @template S, T
|
||||
@@ -423,7 +429,7 @@ export function forEachCorner(extent, callback, opt_this) {
|
||||
|
||||
/**
|
||||
* Get the size of an extent.
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @return {number} Area.
|
||||
* @api
|
||||
*/
|
||||
@@ -438,8 +444,8 @@ export function getArea(extent) {
|
||||
|
||||
/**
|
||||
* Get the bottom left coordinate of an extent.
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @return {ol.Coordinate} Bottom left coordinate.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @return {module:ol/coordinate~Coordinate} Bottom left coordinate.
|
||||
* @api
|
||||
*/
|
||||
export function getBottomLeft(extent) {
|
||||
@@ -449,8 +455,8 @@ export function getBottomLeft(extent) {
|
||||
|
||||
/**
|
||||
* Get the bottom right coordinate of an extent.
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @return {ol.Coordinate} Bottom right coordinate.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @return {module:ol/coordinate~Coordinate} Bottom right coordinate.
|
||||
* @api
|
||||
*/
|
||||
export function getBottomRight(extent) {
|
||||
@@ -460,8 +466,8 @@ export function getBottomRight(extent) {
|
||||
|
||||
/**
|
||||
* Get the center coordinate of an extent.
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @return {ol.Coordinate} Center.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @return {module:ol/coordinate~Coordinate} Center.
|
||||
* @api
|
||||
*/
|
||||
export function getCenter(extent) {
|
||||
@@ -471,9 +477,9 @@ export function getCenter(extent) {
|
||||
|
||||
/**
|
||||
* Get a corner coordinate of an extent.
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {ol.extent.Corner} corner Corner.
|
||||
* @return {ol.Coordinate} Corner coordinate.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {module:ol/extent~Extent.Corner} corner Corner.
|
||||
* @return {module:ol/coordinate~Coordinate} Corner coordinate.
|
||||
*/
|
||||
export function getCorner(extent, corner) {
|
||||
let coordinate;
|
||||
@@ -488,13 +494,13 @@ export function getCorner(extent, corner) {
|
||||
} else {
|
||||
assert(false, 13); // Invalid corner
|
||||
}
|
||||
return /** @type {!ol.Coordinate} */ (coordinate);
|
||||
return /** @type {!module:ol/coordinate~Coordinate} */ (coordinate);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Extent} extent1 Extent 1.
|
||||
* @param {ol.Extent} extent2 Extent 2.
|
||||
* @param {module:ol/extent~Extent} extent1 Extent 1.
|
||||
* @param {module:ol/extent~Extent} extent2 Extent 2.
|
||||
* @return {number} Enlarged area.
|
||||
*/
|
||||
export function getEnlargedArea(extent1, extent2) {
|
||||
@@ -507,12 +513,12 @@ export function getEnlargedArea(extent1, extent2) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Coordinate} center Center.
|
||||
* @param {module:ol/coordinate~Coordinate} center Center.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} rotation Rotation.
|
||||
* @param {ol.Size} size Size.
|
||||
* @param {ol.Extent=} opt_extent Destination extent.
|
||||
* @return {ol.Extent} Extent.
|
||||
* @param {module:ol/size~Size} size Size.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Destination extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
*/
|
||||
export function getForViewAndSize(center, resolution, rotation, size, opt_extent) {
|
||||
const dx = resolution * size[0] / 2;
|
||||
@@ -542,7 +548,7 @@ export function getForViewAndSize(center, resolution, rotation, size, opt_extent
|
||||
|
||||
/**
|
||||
* Get the height of an extent.
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @return {number} Height.
|
||||
* @api
|
||||
*/
|
||||
@@ -552,8 +558,8 @@ export function getHeight(extent) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Extent} extent1 Extent 1.
|
||||
* @param {ol.Extent} extent2 Extent 2.
|
||||
* @param {module:ol/extent~Extent} extent1 Extent 1.
|
||||
* @param {module:ol/extent~Extent} extent2 Extent 2.
|
||||
* @return {number} Intersection area.
|
||||
*/
|
||||
export function getIntersectionArea(extent1, extent2) {
|
||||
@@ -564,10 +570,10 @@ export function getIntersectionArea(extent1, extent2) {
|
||||
|
||||
/**
|
||||
* Get the intersection of two extents.
|
||||
* @param {ol.Extent} extent1 Extent 1.
|
||||
* @param {ol.Extent} extent2 Extent 2.
|
||||
* @param {ol.Extent=} opt_extent Optional extent to populate with intersection.
|
||||
* @return {ol.Extent} Intersecting extent.
|
||||
* @param {module:ol/extent~Extent} extent1 Extent 1.
|
||||
* @param {module:ol/extent~Extent} extent2 Extent 2.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Optional extent to populate with intersection.
|
||||
* @return {module:ol/extent~Extent} Intersecting extent.
|
||||
* @api
|
||||
*/
|
||||
export function getIntersection(extent1, extent2, opt_extent) {
|
||||
@@ -601,7 +607,7 @@ export function getIntersection(extent1, extent2, opt_extent) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @return {number} Margin.
|
||||
*/
|
||||
export function getMargin(extent) {
|
||||
@@ -611,8 +617,8 @@ export function getMargin(extent) {
|
||||
|
||||
/**
|
||||
* Get the size (width, height) of an extent.
|
||||
* @param {ol.Extent} extent The extent.
|
||||
* @return {ol.Size} The extent size.
|
||||
* @param {module:ol/extent~Extent} extent The extent.
|
||||
* @return {module:ol/size~Size} The extent size.
|
||||
* @api
|
||||
*/
|
||||
export function getSize(extent) {
|
||||
@@ -622,8 +628,8 @@ export function getSize(extent) {
|
||||
|
||||
/**
|
||||
* Get the top left coordinate of an extent.
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @return {ol.Coordinate} Top left coordinate.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @return {module:ol/coordinate~Coordinate} Top left coordinate.
|
||||
* @api
|
||||
*/
|
||||
export function getTopLeft(extent) {
|
||||
@@ -633,8 +639,8 @@ export function getTopLeft(extent) {
|
||||
|
||||
/**
|
||||
* Get the top right coordinate of an extent.
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @return {ol.Coordinate} Top right coordinate.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @return {module:ol/coordinate~Coordinate} Top right coordinate.
|
||||
* @api
|
||||
*/
|
||||
export function getTopRight(extent) {
|
||||
@@ -644,7 +650,7 @@ export function getTopRight(extent) {
|
||||
|
||||
/**
|
||||
* Get the width of an extent.
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @return {number} Width.
|
||||
* @api
|
||||
*/
|
||||
@@ -655,8 +661,8 @@ export function getWidth(extent) {
|
||||
|
||||
/**
|
||||
* Determine if one extent intersects another.
|
||||
* @param {ol.Extent} extent1 Extent 1.
|
||||
* @param {ol.Extent} extent2 Extent.
|
||||
* @param {module:ol/extent~Extent} extent1 Extent 1.
|
||||
* @param {module:ol/extent~Extent} extent2 Extent.
|
||||
* @return {boolean} The two extents intersect.
|
||||
* @api
|
||||
*/
|
||||
@@ -670,7 +676,7 @@ export function intersects(extent1, extent2) {
|
||||
|
||||
/**
|
||||
* Determine if an extent is empty.
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @return {boolean} Is empty.
|
||||
* @api
|
||||
*/
|
||||
@@ -680,9 +686,9 @@ export function isEmpty(extent) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {ol.Extent=} opt_extent Extent.
|
||||
* @return {ol.Extent} Extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
*/
|
||||
export function returnOrUpdate(extent, opt_extent) {
|
||||
if (opt_extent) {
|
||||
@@ -698,7 +704,7 @@ export function returnOrUpdate(extent, opt_extent) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {number} value Value.
|
||||
*/
|
||||
export function scaleFromCenter(extent, value) {
|
||||
@@ -714,9 +720,9 @@ export function scaleFromCenter(extent, value) {
|
||||
/**
|
||||
* Determine if the segment between two coordinates intersects (crosses,
|
||||
* touches, or is contained by) the provided extent.
|
||||
* @param {ol.Extent} extent The extent.
|
||||
* @param {ol.Coordinate} start Segment start coordinate.
|
||||
* @param {ol.Coordinate} end Segment end coordinate.
|
||||
* @param {module:ol/extent~Extent} extent The extent.
|
||||
* @param {module:ol/coordinate~Coordinate} start Segment start coordinate.
|
||||
* @param {module:ol/coordinate~Coordinate} end Segment end coordinate.
|
||||
* @return {boolean} The segment intersects the extent.
|
||||
*/
|
||||
export function intersectsSegment(extent, start, end) {
|
||||
@@ -769,11 +775,11 @@ export function intersectsSegment(extent, start, end) {
|
||||
|
||||
/**
|
||||
* Apply a transform function to the extent.
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {ol.TransformFunction} transformFn Transform function. Called with
|
||||
* [minX, minY, maxX, maxY] extent coordinates.
|
||||
* @param {ol.Extent=} opt_extent Destination extent.
|
||||
* @return {ol.Extent} Extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {module:ol/proj~TransformFunction} transformFn Transform function.
|
||||
* Called with `[minX, minY, maxX, maxY]` extent coordinates.
|
||||
* @param {module:ol/extent~Extent=} opt_extent Destination extent.
|
||||
* @return {module:ol/extent~Extent} Extent.
|
||||
* @api
|
||||
*/
|
||||
export function applyTransform(extent, transformFn, opt_extent) {
|
||||
|
||||
Reference in New Issue
Block a user