Named exports from ol/array module
This commit is contained in:
committed by
Frederic Junod
parent
767f61ba78
commit
02002082bf
@@ -4,7 +4,7 @@
|
||||
import {DEFAULT_TILE_SIZE} from './common.js';
|
||||
import {assert} from '../asserts.js';
|
||||
import TileRange from '../TileRange.js';
|
||||
import _ol_array_ from '../array.js';
|
||||
import {isSorted, linearFindNearest} from '../array.js';
|
||||
import {createOrUpdate, getTopLeft} from '../extent.js';
|
||||
import _ol_math_ from '../math.js';
|
||||
import _ol_size_ from '../size.js';
|
||||
@@ -33,7 +33,7 @@ var _ol_tilegrid_TileGrid_ = function(options) {
|
||||
* @type {!Array.<number>}
|
||||
*/
|
||||
this.resolutions_ = options.resolutions;
|
||||
assert(_ol_array_.isSorted(this.resolutions_, function(a, b) {
|
||||
assert(isSorted(this.resolutions_, function(a, b) {
|
||||
return b - a;
|
||||
}, true), 17); // `resolutions` must be sorted in descending order
|
||||
|
||||
@@ -528,8 +528,7 @@ _ol_tilegrid_TileGrid_.prototype.getFullTileRange = function(z) {
|
||||
*/
|
||||
_ol_tilegrid_TileGrid_.prototype.getZForResolution = function(
|
||||
resolution, opt_direction) {
|
||||
var z = _ol_array_.linearFindNearest(this.resolutions_, resolution,
|
||||
opt_direction || 0);
|
||||
var z = linearFindNearest(this.resolutions_, resolution, opt_direction || 0);
|
||||
return _ol_math_.clamp(z, this.minZoom, this.maxZoom);
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @module ol/tilegrid/WMTS
|
||||
*/
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_array_ from '../array.js';
|
||||
import {find} from '../array.js';
|
||||
import {get as getProjection} from '../proj.js';
|
||||
import _ol_tilegrid_TileGrid_ from '../tilegrid/TileGrid.js';
|
||||
|
||||
@@ -110,7 +110,7 @@ _ol_tilegrid_WMTS_.createFromCapabilitiesMatrixSet = function(matrixSet, opt_ext
|
||||
// use of matrixLimits to filter TileMatrices from GetCapabilities
|
||||
// TileMatrixSet from unavailable matrix levels.
|
||||
if (matrixLimits.length > 0) {
|
||||
matrixAvailable = _ol_array_.find(matrixLimits,
|
||||
matrixAvailable = find(matrixLimits,
|
||||
function(elt_ml, index_ml, array_ml) {
|
||||
return elt[identifierPropName] == elt_ml[matrixIdsPropName];
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user