Merge pull request #8084 from pfirpfel/move-reproj-typedefs-to-ol/reproj

Move ol.Reproj* typedefs to ol/reproj
This commit is contained in:
Andreas Hocevar
2018-04-18 17:37:27 +02:00
committed by GitHub
4 changed files with 24 additions and 25 deletions

View File

@@ -11,6 +11,12 @@ import {getCenter, getIntersection, getHeight, getWidth} from '../extent.js';
import {calculateSourceResolution, render as renderReprojected} from '../reproj.js';
import Triangulation from '../reproj/Triangulation.js';
/**
* @typedef {function(module:ol/extent~Extent, number, number) : module:ol/ImageBase~ImageBase} FunctionType
*/
/**
* @classdesc
* Class encapsulating single reprojected image.
@@ -23,7 +29,7 @@ import Triangulation from '../reproj/Triangulation.js';
* @param {module:ol/extent~Extent} targetExtent Target extent.
* @param {number} targetResolution Target resolution.
* @param {number} pixelRatio Pixel ratio.
* @param {ol.ReprojImageFunctionType} getImageFunction
* @param {module:ol/reproj/Image~FunctionType} getImageFunction
* Function returning source images (extent, resolution, pixelRatio).
*/
const ReprojImage = function(sourceProj, targetProj,

View File

@@ -12,6 +12,12 @@ import {clamp} from '../math.js';
import {calculateSourceResolution, render as renderReprojected} from '../reproj.js';
import Triangulation from '../reproj/Triangulation.js';
/**
* @typedef {function(number, number, number, number) : module:ol/Tile~Tile} FunctionType
*/
/**
* @classdesc
* Class encapsulating single reprojected tile.
@@ -27,7 +33,7 @@ import Triangulation from '../reproj/Triangulation.js';
* @param {module:ol/tilecoord~TileCoord} wrappedTileCoord Coordinate of the tile wrapped in X.
* @param {number} pixelRatio Pixel ratio.
* @param {number} gutter Gutter of the source tiles.
* @param {ol.ReprojTileFunctionType} getTileFunction
* @param {module:ol/reproj/Tile~FunctionType} getTileFunction
* Function returning source tiles (z, x, y, pixelRatio).
* @param {number=} opt_errorThreshold Acceptable reprojection error (in px).
* @param {boolean=} opt_renderEdges Render reprojection edges.

View File

@@ -7,6 +7,14 @@ import {modulo} from '../math.js';
import {getTransform} from '../proj.js';
/**
* Single triangle; consists of 3 source points and 3 target points.
* @typedef {Object} Triangle
* @property {Array.<module:ol/coordinate~Coordinate>} source
* @property {Array.<module:ol/coordinate~Coordinate>} target
*/
/**
* Maximum number of subdivision steps during raster reprojection triangulation.
* Prevents high memory usage and large number of proj4 calls (for certain
@@ -85,7 +93,7 @@ const Triangulation = function(sourceProj, targetProj, targetExtent,
this.errorThresholdSquared_ = errorThreshold * errorThreshold;
/**
* @type {Array.<ol.ReprojTriangle>}
* @type {Array.<module:ol/reproj/Triangulation~Triangle>}
* @private
*/
this.triangles_ = [];
@@ -340,7 +348,7 @@ Triangulation.prototype.calculateSourceExtent = function() {
/**
* @return {Array.<ol.ReprojTriangle>} Array of the calculated triangles.
* @return {Array.<module:ol/reproj/Triangulation~Triangle>} Array of the calculated triangles.
*/
Triangulation.prototype.getTriangles = function() {
return this.triangles_;

View File

@@ -181,27 +181,6 @@ ol.RasterOperation;
ol.RegularShapeRenderOptions;
/**
* @typedef {function(module:ol/extent~Extent, number, number) : module:ol/ImageBase~ImageBase}
*/
ol.ReprojImageFunctionType;
/**
* @typedef {function(number, number, number, number) : module:ol/Tile~Tile}
*/
ol.ReprojTileFunctionType;
/**
* Single triangle; consists of 3 source points and 3 target points.
*
* @typedef {{source: Array.<module:ol/coordinate~Coordinate>,
* target: Array.<module:ol/coordinate~Coordinate>}}
*/
ol.ReprojTriangle;
/**
* Number of features; bounds/extent.
* @typedef {{numberOfFeatures: number,