Merge pull request #7861 from fredj/named_export
Named exports from ol/structs/PriorityQueue
This commit is contained in:
@@ -27,7 +27,7 @@ import LayerGroup from './layer/Group.js';
|
||||
import {getMapRendererPlugins} from './plugins.js';
|
||||
import RendererType from './renderer/Type.js';
|
||||
import {hasArea} from './size.js';
|
||||
import PriorityQueue from './structs/PriorityQueue.js';
|
||||
import {DROP} from './structs/PriorityQueue.js';
|
||||
import {create as createTransform, apply as applyTransform} from './transform.js';
|
||||
|
||||
|
||||
@@ -878,10 +878,10 @@ PluggableMap.prototype.getTilePriority = function(tile, tileSourceKey, tileCente
|
||||
// are outside the visible extent.
|
||||
const frameState = this.frameState_;
|
||||
if (!frameState || !(tileSourceKey in frameState.wantedTiles)) {
|
||||
return PriorityQueue.DROP;
|
||||
return DROP;
|
||||
}
|
||||
if (!frameState.wantedTiles[tileSourceKey][tile.getKey()]) {
|
||||
return PriorityQueue.DROP;
|
||||
return DROP;
|
||||
}
|
||||
// Prioritize the highest zoom level tiles closest to the focus.
|
||||
// Tiles at higher zoom levels are prioritized using Math.log(tileResolution).
|
||||
|
||||
@@ -55,10 +55,9 @@ const PriorityQueue = function(priorityFunction, keyFunction) {
|
||||
|
||||
|
||||
/**
|
||||
* @const
|
||||
* @type {number}
|
||||
*/
|
||||
PriorityQueue.DROP = Infinity;
|
||||
export const DROP = Infinity;
|
||||
|
||||
|
||||
/**
|
||||
@@ -102,7 +101,7 @@ PriorityQueue.prototype.enqueue = function(element) {
|
||||
assert(!(this.keyFunction_(element) in this.queuedElements_),
|
||||
31); // Tried to enqueue an `element` that was already added to the queue
|
||||
const priority = this.priorityFunction_(element);
|
||||
if (priority != PriorityQueue.DROP) {
|
||||
if (priority != DROP) {
|
||||
this.elements_.push(element);
|
||||
this.priorities_.push(priority);
|
||||
this.queuedElements_[this.keyFunction_(element)] = true;
|
||||
@@ -262,7 +261,7 @@ PriorityQueue.prototype.reprioritize = function() {
|
||||
for (i = 0; i < n; ++i) {
|
||||
element = elements[i];
|
||||
priority = priorityFunction(element);
|
||||
if (priority == PriorityQueue.DROP) {
|
||||
if (priority == DROP) {
|
||||
delete this.queuedElements_[this.keyFunction_(element)];
|
||||
} else {
|
||||
priorities[index] = priority;
|
||||
|
||||
Reference in New Issue
Block a user