Named exports from tilecoord
This commit is contained in:
@@ -8,7 +8,7 @@ import {jsonp as requestJSONP} from '../net.js';
|
||||
import {get as getProjection, getTransformFromProjections} from '../proj.js';
|
||||
import SourceState from '../source/State.js';
|
||||
import TileImage from '../source/TileImage.js';
|
||||
import _ol_tilecoord_ from '../tilecoord.js';
|
||||
import {createOrUpdate, quadKey} from '../tilecoord.js';
|
||||
import {createXYZ, extentFromProjection} from '../tilegrid.js';
|
||||
|
||||
/**
|
||||
@@ -159,14 +159,12 @@ BingMaps.prototype.handleImageryMetadataResponse = function(response) {
|
||||
if (!tileCoord) {
|
||||
return undefined;
|
||||
} else {
|
||||
_ol_tilecoord_.createOrUpdate(tileCoord[0], tileCoord[1],
|
||||
-tileCoord[2] - 1, quadKeyTileCoord);
|
||||
createOrUpdate(tileCoord[0], tileCoord[1], -tileCoord[2] - 1, quadKeyTileCoord);
|
||||
let url = imageUrl;
|
||||
if (hidpi) {
|
||||
url += '&dpi=d1&device=mobile';
|
||||
}
|
||||
return url.replace('{quadkey}', _ol_tilecoord_.quadKey(
|
||||
quadKeyTileCoord));
|
||||
return url.replace('{quadkey}', quadKey(quadKeyTileCoord));
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@@ -8,7 +8,7 @@ import Event from '../events/Event.js';
|
||||
import {equivalent} from '../proj.js';
|
||||
import {toSize, scale as scaleSize} from '../size.js';
|
||||
import Source from '../source/Source.js';
|
||||
import _ol_tilecoord_ from '../tilecoord.js';
|
||||
import {getKeyZXY, withinExtentAndZ} from '../tilecoord.js';
|
||||
import {wrapX, getForProjection as getTileGridForProjection} from '../tilegrid.js';
|
||||
|
||||
/**
|
||||
@@ -120,7 +120,7 @@ TileSource.prototype.forEachLoadedTile = function(projection, z, tileRange, call
|
||||
let tile, tileCoordKey, loaded;
|
||||
for (let x = tileRange.minX; x <= tileRange.maxX; ++x) {
|
||||
for (let y = tileRange.minY; y <= tileRange.maxY; ++y) {
|
||||
tileCoordKey = _ol_tilecoord_.getKeyZXY(z, x, y);
|
||||
tileCoordKey = getKeyZXY(z, x, y);
|
||||
loaded = false;
|
||||
if (tileCache.containsKey(tileCoordKey)) {
|
||||
tile = /** @type {!ol.Tile} */ (tileCache.get(tileCoordKey));
|
||||
@@ -283,7 +283,7 @@ TileSource.prototype.getTileCoordForTileUrlFunction = function(tileCoord, opt_pr
|
||||
if (this.getWrapX() && projection.isGlobal()) {
|
||||
tileCoord = wrapX(tileGrid, tileCoord, projection);
|
||||
}
|
||||
return _ol_tilecoord_.withinExtentAndZ(tileCoord, tileGrid) ? tileCoord : null;
|
||||
return withinExtentAndZ(tileCoord, tileGrid) ? tileCoord : null;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import {modulo} from '../math.js';
|
||||
import {assign} from '../obj.js';
|
||||
import {toSize, scale as scaleSize} from '../size.js';
|
||||
import TileImage from '../source/TileImage.js';
|
||||
import _ol_tilecoord_ from '../tilecoord.js';
|
||||
import {hash as tileCoordHash} from '../tilecoord.js';
|
||||
import {appendParams} from '../uri.js';
|
||||
|
||||
/**
|
||||
@@ -118,7 +118,7 @@ TileArcGISRest.prototype.getRequestUrl_ = function(tileCoord, tileSize, tileExte
|
||||
if (urls.length == 1) {
|
||||
url = urls[0];
|
||||
} else {
|
||||
const index = modulo(_ol_tilecoord_.hash(tileCoord), urls.length);
|
||||
const index = modulo(tileCoordHash(tileCoord), urls.length);
|
||||
url = urls[index];
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import TileState from '../TileState.js';
|
||||
import {createCanvasContext2D} from '../dom.js';
|
||||
import {toSize} from '../size.js';
|
||||
import TileSource from '../source/Tile.js';
|
||||
import _ol_tilecoord_ from '../tilecoord.js';
|
||||
import {getKeyZXY} from '../tilecoord.js';
|
||||
|
||||
|
||||
/**
|
||||
@@ -106,7 +106,7 @@ inherits(TileDebug, TileSource);
|
||||
* @inheritDoc
|
||||
*/
|
||||
TileDebug.prototype.getTile = function(z, x, y) {
|
||||
const tileCoordKey = _ol_tilecoord_.getKeyZXY(z, x, y);
|
||||
const tileCoordKey = getKeyZXY(z, x, y);
|
||||
if (this.tileCache.containsKey(tileCoordKey)) {
|
||||
return /** @type {!ol.source.LabeledTile} */ (this.tileCache.get(tileCoordKey));
|
||||
} else {
|
||||
|
||||
@@ -11,7 +11,7 @@ import EventType from '../events/EventType.js';
|
||||
import {equivalent, get as getProjection} from '../proj.js';
|
||||
import ReprojTile from '../reproj/Tile.js';
|
||||
import UrlTile from '../source/UrlTile.js';
|
||||
import _ol_tilecoord_ from '../tilecoord.js';
|
||||
import {getKey, getKeyZXY} from '../tilecoord.js';
|
||||
import {getForProjection as getTileGridForProjection} from '../tilegrid.js';
|
||||
|
||||
/**
|
||||
@@ -242,7 +242,7 @@ TileImage.prototype.getTile = function(z, x, y, pixelRatio, projection) {
|
||||
const cache = this.getTileCacheForProjection(projection);
|
||||
const tileCoord = [z, x, y];
|
||||
let tile;
|
||||
const tileCoordKey = _ol_tilecoord_.getKey(tileCoord);
|
||||
const tileCoordKey = getKey(tileCoord);
|
||||
if (cache.containsKey(tileCoordKey)) {
|
||||
tile = /** @type {!ol.Tile} */ (cache.get(tileCoordKey));
|
||||
}
|
||||
@@ -289,7 +289,7 @@ TileImage.prototype.getTile = function(z, x, y, pixelRatio, projection) {
|
||||
*/
|
||||
TileImage.prototype.getTileInternal = function(z, x, y, pixelRatio, projection) {
|
||||
let tile = null;
|
||||
const tileCoordKey = _ol_tilecoord_.getKeyZXY(z, x, y);
|
||||
const tileCoordKey = getKeyZXY(z, x, y);
|
||||
const key = this.getKey();
|
||||
if (!this.tileCache.containsKey(tileCoordKey)) {
|
||||
tile = this.createTile_(z, x, y, pixelRatio, projection, key);
|
||||
|
||||
@@ -13,7 +13,7 @@ import {jsonp as requestJSONP} from '../net.js';
|
||||
import {get as getProjection, getTransformFromProjections} from '../proj.js';
|
||||
import SourceState from '../source/State.js';
|
||||
import TileSource from '../source/Tile.js';
|
||||
import _ol_tilecoord_ from '../tilecoord.js';
|
||||
import {getKeyZXY} from '../tilecoord.js';
|
||||
import {createXYZ, extentFromProjection} from '../tilegrid.js';
|
||||
|
||||
|
||||
@@ -447,7 +447,7 @@ UTFGrid.prototype.handleTileJSONResponse = function(tileJSON) {
|
||||
* @inheritDoc
|
||||
*/
|
||||
UTFGrid.prototype.getTile = function(z, x, y, pixelRatio, projection) {
|
||||
const tileCoordKey = _ol_tilecoord_.getKeyZXY(z, x, y);
|
||||
const tileCoordKey = getKeyZXY(z, x, y);
|
||||
if (this.tileCache.containsKey(tileCoordKey)) {
|
||||
return /** @type {!ol.Tile} */ (this.tileCache.get(tileCoordKey));
|
||||
} else {
|
||||
@@ -472,7 +472,7 @@ UTFGrid.prototype.getTile = function(z, x, y, pixelRatio, projection) {
|
||||
* @inheritDoc
|
||||
*/
|
||||
UTFGrid.prototype.useTile = function(z, x, y) {
|
||||
const tileCoordKey = _ol_tilecoord_.getKeyZXY(z, x, y);
|
||||
const tileCoordKey = getKeyZXY(z, x, y);
|
||||
if (this.tileCache.containsKey(tileCoordKey)) {
|
||||
this.tileCache.get(tileCoordKey);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import {calculateSourceResolution} from '../reproj.js';
|
||||
import {toSize, buffer as bufferSize, scale as scaleSize} from '../size.js';
|
||||
import TileImage from '../source/TileImage.js';
|
||||
import WMSServerType from '../source/WMSServerType.js';
|
||||
import _ol_tilecoord_ from '../tilecoord.js';
|
||||
import {hash as tileCoordHash} from '../tilecoord.js';
|
||||
import {compareVersions} from '../string.js';
|
||||
import {appendParams} from '../uri.js';
|
||||
|
||||
@@ -247,7 +247,7 @@ TileWMS.prototype.getRequestUrl_ = function(tileCoord, tileSize, tileExtent,
|
||||
if (urls.length == 1) {
|
||||
url = urls[0];
|
||||
} else {
|
||||
const index = modulo(_ol_tilecoord_.hash(tileCoord), urls.length);
|
||||
const index = modulo(tileCoordHash(tileCoord), urls.length);
|
||||
url = urls[index];
|
||||
}
|
||||
return appendParams(url, params);
|
||||
|
||||
@@ -6,7 +6,7 @@ import TileState from '../TileState.js';
|
||||
import {expandUrl, createFromTemplates, nullTileUrlFunction} from '../tileurlfunction.js';
|
||||
import TileSource from '../source/Tile.js';
|
||||
import TileEventType from '../source/TileEventType.js';
|
||||
import _ol_tilecoord_ from '../tilecoord.js';
|
||||
import {getKeyZXY} from '../tilecoord.js';
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
@@ -195,7 +195,7 @@ UrlTile.prototype.setUrls = function(urls) {
|
||||
* @inheritDoc
|
||||
*/
|
||||
UrlTile.prototype.useTile = function(z, x, y) {
|
||||
const tileCoordKey = _ol_tilecoord_.getKeyZXY(z, x, y);
|
||||
const tileCoordKey = getKeyZXY(z, x, y);
|
||||
if (this.tileCache.containsKey(tileCoordKey)) {
|
||||
this.tileCache.get(tileCoordKey);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import VectorImageTile, {defaultLoadFunction} from '../VectorImageTile.js';
|
||||
import VectorTile from '../VectorTile.js';
|
||||
import {toSize} from '../size.js';
|
||||
import UrlTile from '../source/UrlTile.js';
|
||||
import _ol_tilecoord_ from '../tilecoord.js';
|
||||
import {getKeyZXY} from '../tilecoord.js';
|
||||
import {createXYZ, extentFromProjection, createForProjection} from '../tilegrid.js';
|
||||
|
||||
/**
|
||||
@@ -110,7 +110,7 @@ VectorTileSource.prototype.clear = function() {
|
||||
* @inheritDoc
|
||||
*/
|
||||
VectorTileSource.prototype.getTile = function(z, x, y, pixelRatio, projection) {
|
||||
const tileCoordKey = _ol_tilecoord_.getKeyZXY(z, x, y);
|
||||
const tileCoordKey = getKeyZXY(z, x, y);
|
||||
if (this.tileCache.containsKey(tileCoordKey)) {
|
||||
return /** @type {!ol.Tile} */ (this.tileCache.get(tileCoordKey));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user