Merge pull request #7985 from fredj/tilegrid-types
Use path type instead of ol.tilegrid
This commit is contained in:
@@ -165,8 +165,8 @@ export function containsXY(extent, x, y) {
|
||||
* Get the relationship between a coordinate and extent.
|
||||
* @param {module:ol/extent~Extent} extent The extent.
|
||||
* @param {module:ol/coordinate~Coordinate} coordinate The coordinate.
|
||||
* @return {number} The relationship (bitwise compare with
|
||||
* module:ol/extent~Extent.Relationship).
|
||||
* @return {module:ol/extent/Relationship~Relationship} The relationship (bitwise compare with
|
||||
* module:ol/extent/Relationship~Relationship).
|
||||
*/
|
||||
export function coordinateRelationship(extent, coordinate) {
|
||||
const minX = extent[0];
|
||||
@@ -478,7 +478,7 @@ export function getCenter(extent) {
|
||||
/**
|
||||
* Get a corner coordinate of an extent.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {module:ol/extent~Extent.Corner} corner Corner.
|
||||
* @param {module:ol/extent/Corner~Corner} corner Corner.
|
||||
* @return {module:ol/coordinate~Coordinate} Corner coordinate.
|
||||
*/
|
||||
export function getCorner(extent, corner) {
|
||||
|
||||
@@ -118,7 +118,7 @@ const Projection = function(options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.tilegrid.TileGrid}
|
||||
* @type {module:ol/tilegrid/TileGrid~TileGrid}
|
||||
*/
|
||||
this.defaultTileGrid_ = null;
|
||||
|
||||
@@ -228,7 +228,7 @@ Projection.prototype.setGlobal = function(global) {
|
||||
|
||||
|
||||
/**
|
||||
* @return {ol.tilegrid.TileGrid} The default tile grid.
|
||||
* @return {module:ol/tilegrid/TileGrid~TileGrid} The default tile grid.
|
||||
*/
|
||||
Projection.prototype.getDefaultTileGrid = function() {
|
||||
return this.defaultTileGrid_;
|
||||
@@ -236,7 +236,7 @@ Projection.prototype.getDefaultTileGrid = function() {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.tilegrid.TileGrid} tileGrid The default tile grid.
|
||||
* @param {module:ol/tilegrid/TileGrid~TileGrid} tileGrid The default tile grid.
|
||||
*/
|
||||
Projection.prototype.setDefaultTileGrid = function(tileGrid) {
|
||||
this.defaultTileGrid_ = tileGrid;
|
||||
|
||||
@@ -196,7 +196,7 @@ LayerRenderer.prototype.updateUsedTiles = function(usedTiles, tileSource, z, til
|
||||
* - enqueues missing tiles
|
||||
* @param {module:ol/PluggableMap~FrameState} frameState Frame state.
|
||||
* @param {ol.source.Tile} tileSource Tile source.
|
||||
* @param {ol.tilegrid.TileGrid} tileGrid Tile grid.
|
||||
* @param {module:ol/tilegrid/TileGrid~TileGrid} tileGrid Tile grid.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
|
||||
@@ -20,9 +20,9 @@ import Triangulation from '../reproj/Triangulation.js';
|
||||
* @constructor
|
||||
* @extends {ol.Tile}
|
||||
* @param {module:ol/proj/Projection~Projection} sourceProj Source projection.
|
||||
* @param {ol.tilegrid.TileGrid} sourceTileGrid Source tile grid.
|
||||
* @param {module:ol/tilegrid/TileGrid~TileGrid} sourceTileGrid Source tile grid.
|
||||
* @param {module:ol/proj/Projection~Projection} targetProj Target projection.
|
||||
* @param {ol.tilegrid.TileGrid} targetTileGrid Target tile grid.
|
||||
* @param {module:ol/tilegrid/TileGrid~TileGrid} targetTileGrid Target tile grid.
|
||||
* @param {module:ol/tilecoord~TileCoord} tileCoord Coordinate of the tile.
|
||||
* @param {module:ol/tilecoord~TileCoord} wrappedTileCoord Coordinate of the tile wrapped in X.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
@@ -64,13 +64,13 @@ const ReprojTile = function(sourceProj, sourceTileGrid,
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.tilegrid.TileGrid}
|
||||
* @type {module:ol/tilegrid/TileGrid~TileGrid}
|
||||
*/
|
||||
this.sourceTileGrid_ = sourceTileGrid;
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.tilegrid.TileGrid}
|
||||
* @type {module:ol/tilegrid/TileGrid~TileGrid}
|
||||
*/
|
||||
this.targetTileGrid_ = targetTileGrid;
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ const TileSource = function(options) {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {ol.tilegrid.TileGrid}
|
||||
* @type {module:ol/tilegrid/TileGrid~TileGrid}
|
||||
*/
|
||||
this.tileGrid = options.tileGrid !== undefined ? options.tileGrid : null;
|
||||
|
||||
@@ -202,7 +202,7 @@ TileSource.prototype.getTile = function(z, x, y, pixelRatio, projection) {};
|
||||
|
||||
/**
|
||||
* Return the tile grid of the tile source.
|
||||
* @return {ol.tilegrid.TileGrid} Tile grid.
|
||||
* @return {module:ol/tilegrid/TileGrid~TileGrid} Tile grid.
|
||||
* @api
|
||||
*/
|
||||
TileSource.prototype.getTileGrid = function() {
|
||||
@@ -212,7 +212,7 @@ TileSource.prototype.getTileGrid = function() {
|
||||
|
||||
/**
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @return {!ol.tilegrid.TileGrid} Tile grid.
|
||||
* @return {!module:ol/tilegrid/TileGrid~TileGrid} Tile grid.
|
||||
*/
|
||||
TileSource.prototype.getTileGridForProjection = function(projection) {
|
||||
if (!this.tileGrid) {
|
||||
|
||||
@@ -67,7 +67,7 @@ const TileImage = function(options) {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {!Object.<string, ol.tilegrid.TileGrid>}
|
||||
* @type {!Object.<string, module:ol/tilegrid/TileGrid~TileGrid>}
|
||||
*/
|
||||
this.tileGridForProjection = {};
|
||||
|
||||
@@ -175,7 +175,7 @@ TileImage.prototype.getTileGridForProjection = function(projection) {
|
||||
if (!(projKey in this.tileGridForProjection)) {
|
||||
this.tileGridForProjection[projKey] = getTileGridForProjection(projection);
|
||||
}
|
||||
return /** @type {!ol.tilegrid.TileGrid} */ (this.tileGridForProjection[projKey]);
|
||||
return /** @type {!module:ol/tilegrid/TileGrid~TileGrid} */ (this.tileGridForProjection[projKey]);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -344,7 +344,7 @@ TileImage.prototype.setRenderReprojectionEdges = function(render) {
|
||||
* for optimization reasons (custom tile size, resolutions, ...).
|
||||
*
|
||||
* @param {module:ol/proj~ProjectionLike} projection Projection.
|
||||
* @param {ol.tilegrid.TileGrid} tilegrid Tile grid to use for the projection.
|
||||
* @param {module:ol/tilegrid/TileGrid~TileGrid} tilegrid Tile grid to use for the projection.
|
||||
* @api
|
||||
*/
|
||||
TileImage.prototype.setTileGridForProjection = function(projection, tilegrid) {
|
||||
|
||||
@@ -81,7 +81,7 @@ const VectorTileSource = function(options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {Object.<string,ol.tilegrid.TileGrid>}
|
||||
* @type {Object.<string, module:ol/tilegrid/TileGrid~TileGrid>}
|
||||
*/
|
||||
this.tileGrids_ = {};
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ const TierSizeCalculation = {
|
||||
/**
|
||||
* @constructor
|
||||
* @extends {ol.ImageTile}
|
||||
* @param {ol.tilegrid.TileGrid} tileGrid TileGrid that the tile belongs to.
|
||||
* @param {module:ol/tilegrid/TileGrid~TileGrid} tileGrid TileGrid that the tile belongs to.
|
||||
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
|
||||
* @param {ol.TileState} state State.
|
||||
* @param {string} src Image source URI.
|
||||
|
||||
@@ -97,7 +97,7 @@ export function quadKey(tileCoord) {
|
||||
|
||||
/**
|
||||
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
|
||||
* @param {!module:ol/tilegrid~TileGrid} tileGrid Tile grid.
|
||||
* @param {!module:ol/tilegrid/TileGrid~TileGrid} tileGrid Tile grid.
|
||||
* @return {boolean} Tile coordinate is within extent and zoom level range.
|
||||
*/
|
||||
export function withinExtentAndZ(tileCoord, tileGrid) {
|
||||
|
||||
@@ -53,15 +53,13 @@ export function wrapX(tileGrid, tileCoord, projection) {
|
||||
* DEFAULT_MAX_ZOOM).
|
||||
* @param {number|module:ol/size~Size=} opt_tileSize Tile size (default uses
|
||||
* DEFAULT_TILE_SIZE).
|
||||
* @param {module:ol/extent~Extent.Corner=} opt_corner Extent corner (default is
|
||||
* module:ol/extent~Extent.Corner.TOP_LEFT).
|
||||
* @param {module:ol/extent/Corner~Corner=} opt_corner Extent corner (default is `'top-left'`).
|
||||
* @return {!module:ol/tilegrid/TileGrid~TileGrid} TileGrid instance.
|
||||
*/
|
||||
export function createForExtent(extent, opt_maxZoom, opt_tileSize, opt_corner) {
|
||||
const corner = opt_corner !== undefined ? opt_corner : Corner.TOP_LEFT;
|
||||
|
||||
const resolutions = resolutionsFromExtent(
|
||||
extent, opt_maxZoom, opt_tileSize);
|
||||
const resolutions = resolutionsFromExtent(extent, opt_maxZoom, opt_tileSize);
|
||||
|
||||
return new TileGrid({
|
||||
extent: extent,
|
||||
@@ -129,14 +127,12 @@ function resolutionsFromExtent(extent, opt_maxZoom, opt_tileSize) {
|
||||
* DEFAULT_MAX_ZOOM).
|
||||
* @param {number|module:ol/size~Size=} opt_tileSize Tile size (default uses
|
||||
* DEFAULT_TILE_SIZE).
|
||||
* @param {module:ol/extent~Extent.Corner=} opt_corner Extent corner (default is
|
||||
* module:ol/extent~Extent.Corner.BOTTOM_LEFT).
|
||||
* @param {module:ol/extent/Corner~Corner=} opt_corner Extent corner (default is `'top-left'`).
|
||||
* @return {!module:ol/tilegrid/TileGrid~TileGrid} TileGrid instance.
|
||||
*/
|
||||
export function createForProjection(projection, opt_maxZoom, opt_tileSize, opt_corner) {
|
||||
const extent = extentFromProjection(projection);
|
||||
return createForExtent(
|
||||
extent, opt_maxZoom, opt_tileSize, opt_corner);
|
||||
return createForExtent(extent, opt_maxZoom, opt_tileSize, opt_corner);
|
||||
}
|
||||
|
||||
|
||||
@@ -150,8 +146,7 @@ export function extentFromProjection(projection) {
|
||||
projection = getProjection(projection);
|
||||
let extent = projection.getExtent();
|
||||
if (!extent) {
|
||||
const half = 180 * METERS_PER_UNIT[Units.DEGREES] /
|
||||
projection.getMetersPerUnit();
|
||||
const half = 180 * METERS_PER_UNIT[Units.DEGREES] / projection.getMetersPerUnit();
|
||||
extent = createOrUpdate(-half, -half, half, half);
|
||||
}
|
||||
return extent;
|
||||
|
||||
@@ -11,7 +11,7 @@ import TileGrid from '../tilegrid/TileGrid.js';
|
||||
* Set the grid pattern for sources accessing WMTS tiled-image servers.
|
||||
*
|
||||
* @constructor
|
||||
* @extends {ol.tilegrid.TileGrid}
|
||||
* @extends {module:ol/tilegrid/TileGrid~TileGrid}
|
||||
* @param {olx.tilegrid.WMTSOptions} options WMTS options.
|
||||
* @struct
|
||||
* @api
|
||||
@@ -67,7 +67,7 @@ export default WMTSTileGrid;
|
||||
* ranges the server provides.
|
||||
* @param {Array.<Object>=} opt_matrixLimits An optional object representing
|
||||
* the available matrices for tileGrid.
|
||||
* @return {ol.tilegrid.WMTS} WMTS tileGrid instance.
|
||||
* @return {module:ol/tilegrid/WMTS~WMTSTileGrid} WMTS tileGrid instance.
|
||||
* @api
|
||||
*/
|
||||
export function createFromCapabilitiesMatrixSet(matrixSet, opt_extent, opt_matrixLimits) {
|
||||
|
||||
Reference in New Issue
Block a user