Merge pull request #7918 from fredj/mv_nullFunction
Move the nullFunction to ol/functions
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/Disposable
|
||||
*/
|
||||
import {nullFunction} from './index.js';
|
||||
import {UNDEFINED} from './functions.js';
|
||||
|
||||
/**
|
||||
* Objects that need to clean up after themselves.
|
||||
@@ -30,5 +30,5 @@ Disposable.prototype.dispose = function() {
|
||||
* Extension point for disposable objects.
|
||||
* @protected
|
||||
*/
|
||||
Disposable.prototype.disposeInternal = nullFunction;
|
||||
Disposable.prototype.disposeInternal = UNDEFINED;
|
||||
export default Disposable;
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
* @module ol/View
|
||||
*/
|
||||
import {DEFAULT_TILE_SIZE} from './tilegrid/common.js';
|
||||
import {inherits, getUid, nullFunction} from './index.js';
|
||||
import {inherits, getUid} from './index.js';
|
||||
import {UNDEFINED} from './functions.js';
|
||||
import {createExtent, none as centerNone} from './centerconstraint.js';
|
||||
import BaseObject from './Object.js';
|
||||
import {createSnapToResolutions, createSnapToPower} from './resolutionconstraint.js';
|
||||
@@ -948,7 +949,7 @@ View.prototype.fit = function(geometryOrExtent, opt_options) {
|
||||
const centerX = centerRotX * cosAngle - centerRotY * sinAngle;
|
||||
const centerY = centerRotY * cosAngle + centerRotX * sinAngle;
|
||||
const center = [centerX, centerY];
|
||||
const callback = options.callback ? options.callback : nullFunction;
|
||||
const callback = options.callback ? options.callback : UNDEFINED;
|
||||
|
||||
if (options.duration !== undefined) {
|
||||
this.animate({
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/**
|
||||
* @module ol/control/Control
|
||||
*/
|
||||
import {inherits, nullFunction} from '../index.js';
|
||||
import {inherits} from '../index.js';
|
||||
import {UNDEFINED} from '../functions.js';
|
||||
import MapEventType from '../MapEventType.js';
|
||||
import BaseObject from '../Object.js';
|
||||
import {removeNode} from '../dom.js';
|
||||
@@ -67,7 +68,7 @@ const Control = function(options) {
|
||||
/**
|
||||
* @type {function(ol.MapEvent)}
|
||||
*/
|
||||
this.render = options.render ? options.render : nullFunction;
|
||||
this.render = options.render ? options.render : UNDEFINED;
|
||||
|
||||
if (options.target) {
|
||||
this.setTarget(options.target);
|
||||
@@ -118,7 +119,7 @@ Control.prototype.setMap = function(map) {
|
||||
const target = this.target_ ?
|
||||
this.target_ : map.getOverlayContainerStopEvent();
|
||||
target.appendChild(this.element);
|
||||
if (this.render !== nullFunction) {
|
||||
if (this.render !== UNDEFINED) {
|
||||
this.listenerKeys.push(listen(map,
|
||||
MapEventType.POSTRENDER, this.render, this));
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
/**
|
||||
* @module ol/events/EventTarget
|
||||
*/
|
||||
import {inherits, nullFunction} from '../index.js';
|
||||
import {inherits} from '../index.js';
|
||||
import Disposable from '../Disposable.js';
|
||||
import {unlistenAll} from '../events.js';
|
||||
import {UNDEFINED} from '../functions.js';
|
||||
import Event from '../events/Event.js';
|
||||
|
||||
/**
|
||||
@@ -96,7 +97,7 @@ EventTarget.prototype.dispatchEvent = function(event) {
|
||||
let pendingRemovals = this.pendingRemovals_[type];
|
||||
delete this.pendingRemovals_[type];
|
||||
while (pendingRemovals--) {
|
||||
this.removeEventListener(type, nullFunction);
|
||||
this.removeEventListener(type, UNDEFINED);
|
||||
}
|
||||
delete this.dispatching_[type];
|
||||
}
|
||||
@@ -147,7 +148,7 @@ EventTarget.prototype.removeEventListener = function(type, listener) {
|
||||
const index = listeners.indexOf(listener);
|
||||
if (type in this.pendingRemovals_) {
|
||||
// make listener a no-op, and remove later in #dispatchEvent()
|
||||
listeners[index] = nullFunction;
|
||||
listeners[index] = UNDEFINED;
|
||||
++this.pendingRemovals_[type];
|
||||
} else {
|
||||
listeners.splice(index, 1);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/featureloader
|
||||
*/
|
||||
import {nullFunction} from './index.js';
|
||||
import {UNDEFINED} from './functions.js';
|
||||
import FormatType from './format/FormatType.js';
|
||||
import {parse} from './xml.js';
|
||||
|
||||
@@ -88,11 +88,11 @@ export function loadFeaturesXhr(url, format, success, failure) {
|
||||
export function xhr(url, format) {
|
||||
return loadFeaturesXhr(url, format,
|
||||
/**
|
||||
* @param {Array.<ol.Feature>} features The loaded features.
|
||||
* @param {ol.proj.Projection} dataProjection Data projection.
|
||||
* @this {ol.source.Vector}
|
||||
*/
|
||||
* @param {Array.<ol.Feature>} features The loaded features.
|
||||
* @param {ol.proj.Projection} dataProjection Data projection.
|
||||
* @this {ol.source.Vector}
|
||||
*/
|
||||
function(features, dataProjection) {
|
||||
this.addFeatures(features);
|
||||
}, /* FIXME handle error */ nullFunction);
|
||||
}, /* FIXME handle error */ UNDEFINED);
|
||||
}
|
||||
|
||||
@@ -17,3 +17,10 @@ export function TRUE() {
|
||||
export function FALSE() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* A reusable function, used e.g. as a default for callbacks.
|
||||
*
|
||||
* @return {undefined} Nothing.
|
||||
*/
|
||||
export function UNDEFINED() {}
|
||||
|
||||
@@ -93,14 +93,6 @@ export function inherits(childCtor, parentCtor) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A reusable function, used e.g. as a default for callbacks.
|
||||
*
|
||||
* @return {undefined} Nothing.
|
||||
*/
|
||||
export function nullFunction() {}
|
||||
|
||||
|
||||
/**
|
||||
* Counter for getUid.
|
||||
* @type {number}
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
*/
|
||||
// FIXME draw drag box
|
||||
import Event from '../events/Event.js';
|
||||
import {inherits, nullFunction} from '../index.js';
|
||||
import {inherits} from '../index.js';
|
||||
import {always, mouseOnly, mouseActionButton} from '../events/condition.js';
|
||||
import {UNDEFINED} from '../functions.js';
|
||||
import PointerInteraction from '../interaction/Pointer.js';
|
||||
import RenderBox from '../render/Box.js';
|
||||
|
||||
@@ -182,7 +183,7 @@ DragBox.prototype.getGeometry = function() {
|
||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
|
||||
* @protected
|
||||
*/
|
||||
DragBox.prototype.onBoxEnd = nullFunction;
|
||||
DragBox.prototype.onBoxEnd = UNDEFINED;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
* @module ol/interaction/Pointer
|
||||
*/
|
||||
import {inherits, nullFunction} from '../index.js';
|
||||
import {FALSE} from '../functions.js';
|
||||
import {inherits} from '../index.js';
|
||||
import {FALSE, UNDEFINED} from '../functions.js';
|
||||
import MapBrowserEventType from '../MapBrowserEventType.js';
|
||||
import MapBrowserPointerEvent from '../MapBrowserPointerEvent.js';
|
||||
import Interaction from '../interaction/Interaction.js';
|
||||
@@ -13,7 +13,7 @@ import {getValues} from '../obj.js';
|
||||
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||
* @this {ol.interaction.Pointer}
|
||||
*/
|
||||
const handleDragEvent = nullFunction;
|
||||
const handleDragEvent = UNDEFINED;
|
||||
|
||||
|
||||
/**
|
||||
@@ -36,7 +36,7 @@ const handleDownEvent = FALSE;
|
||||
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||
* @this {ol.interaction.Pointer}
|
||||
*/
|
||||
const handleMoveEvent = nullFunction;
|
||||
const handleMoveEvent = UNDEFINED;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @module ol/render/Feature
|
||||
*/
|
||||
import {nullFunction} from '../index.js';
|
||||
import {UNDEFINED} from '../functions.js';
|
||||
import {extend} from '../array.js';
|
||||
import {createOrUpdateFromCoordinate, createOrUpdateFromFlatCoordinates, getCenter, getHeight} from '../extent.js';
|
||||
import GeometryType from '../geom/GeometryType.js';
|
||||
@@ -244,7 +244,7 @@ RenderFeature.prototype.getStride = function() {
|
||||
/**
|
||||
* @return {undefined}
|
||||
*/
|
||||
RenderFeature.prototype.getStyleFunction = nullFunction;
|
||||
RenderFeature.prototype.getStyleFunction = UNDEFINED;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/**
|
||||
* @module ol/render/canvas/Replay
|
||||
*/
|
||||
import {getUid, inherits, nullFunction} from '../../index.js';
|
||||
import {getUid, inherits} from '../../index.js';
|
||||
import {UNDEFINED} from '../../functions.js';
|
||||
import {equals, reverseSubArray} from '../../array.js';
|
||||
import {asColorLike} from '../../colorlike.js';
|
||||
import {buffer, clone, coordinateRelationship, createEmpty, createOrUpdate,
|
||||
@@ -1068,7 +1069,7 @@ CanvasReplay.prototype.endGeometry = function(geometry, feature) {
|
||||
/**
|
||||
* FIXME empty description for jsdoc
|
||||
*/
|
||||
CanvasReplay.prototype.finish = nullFunction;
|
||||
CanvasReplay.prototype.finish = UNDEFINED;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/**
|
||||
* @module ol/renderer/Layer
|
||||
*/
|
||||
import {getUid, inherits, nullFunction} from '../index.js';
|
||||
import {getUid, inherits} from '../index.js';
|
||||
import ImageState from '../ImageState.js';
|
||||
import Observable from '../Observable.js';
|
||||
import TileState from '../TileState.js';
|
||||
import {listen} from '../events.js';
|
||||
import EventType from '../events/EventType.js';
|
||||
import {FALSE} from '../functions.js';
|
||||
import {FALSE, UNDEFINED} from '../functions.js';
|
||||
import SourceState from '../source/State.js';
|
||||
|
||||
/**
|
||||
@@ -42,7 +42,7 @@ inherits(LayerRenderer, Observable);
|
||||
* @return {T|undefined} Callback result.
|
||||
* @template S,T
|
||||
*/
|
||||
LayerRenderer.prototype.forEachFeatureAtCoordinate = nullFunction;
|
||||
LayerRenderer.prototype.forEachFeatureAtCoordinate = UNDEFINED;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/**
|
||||
* @module ol/renderer/Map
|
||||
*/
|
||||
import {getUid, inherits, nullFunction} from '../index.js';
|
||||
import {getUid, inherits} from '../index.js';
|
||||
import Disposable from '../Disposable.js';
|
||||
import {listen, unlistenByKey} from '../events.js';
|
||||
import EventType from '../events/EventType.js';
|
||||
import {getWidth} from '../extent.js';
|
||||
import {TRUE} from '../functions.js';
|
||||
import {TRUE, UNDEFINED} from '../functions.js';
|
||||
import {visibleAtResolution} from '../layer/Layer.js';
|
||||
import {getLayerRendererPlugins} from '../plugins.js';
|
||||
import {iconImageCache} from '../style.js';
|
||||
@@ -289,7 +289,7 @@ MapRenderer.prototype.removeLayerRendererByKey_ = function(layerKey) {
|
||||
* Render.
|
||||
* @param {?olx.FrameState} frameState Frame state.
|
||||
*/
|
||||
MapRenderer.prototype.renderFrame = nullFunction;
|
||||
MapRenderer.prototype.renderFrame = UNDEFINED;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
/**
|
||||
* @module ol/renderer/canvas/IntermediateCanvas
|
||||
*/
|
||||
import {inherits, nullFunction} from '../../index.js';
|
||||
import {inherits} from '../../index.js';
|
||||
import {scale as scaleCoordinate} from '../../coordinate.js';
|
||||
import {createCanvasContext2D} from '../../dom.js';
|
||||
import {containsExtent, intersects} from '../../extent.js';
|
||||
import {UNDEFINED} from '../../functions.js';
|
||||
import CanvasLayerRenderer from '../canvas/Layer.js';
|
||||
import {create as createTransform, apply as applyTransform} from '../../transform.js';
|
||||
|
||||
@@ -123,7 +124,7 @@ IntermediateCanvasRenderer.prototype.forEachLayerAtCoordinate = function(coordin
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (this.getLayer().getSource().forEachFeatureAtCoordinate !== nullFunction) {
|
||||
if (this.getLayer().getSource().forEachFeatureAtCoordinate !== UNDEFINED) {
|
||||
// for ImageCanvas sources use the original hit-detection logic,
|
||||
// so that for example also transparent polygons are detected
|
||||
return CanvasLayerRenderer.prototype.forEachLayerAtCoordinate.apply(this, arguments);
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
* @module ol/renderer/webgl/ImageLayer
|
||||
*/
|
||||
import {ENABLE_RASTER_REPROJECTION} from '../../reproj/common.js';
|
||||
import {inherits, nullFunction} from '../../index.js';
|
||||
import {inherits} from '../../index.js';
|
||||
import {UNDEFINED} from '../../functions.js';
|
||||
import LayerType from '../../LayerType.js';
|
||||
import ViewHint from '../../ViewHint.js';
|
||||
import {createCanvasContext2D} from '../../dom.js';
|
||||
@@ -254,7 +255,7 @@ WebGLImageLayerRenderer.prototype.forEachLayerAtPixel = function(pixel, frameSta
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (this.getLayer().getSource().forEachFeatureAtCoordinate !== nullFunction) {
|
||||
if (this.getLayer().getSource().forEachFeatureAtCoordinate !== UNDEFINED) {
|
||||
// for ImageCanvas sources use the original hit-detection logic,
|
||||
// so that for example also transparent polygons are detected
|
||||
const coordinate = applyTransform(
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/**
|
||||
* @module ol/source/Source
|
||||
*/
|
||||
import {inherits, nullFunction} from '../index.js';
|
||||
import {inherits} from '../index.js';
|
||||
import {UNDEFINED} from '../functions.js';
|
||||
import BaseObject from '../Object.js';
|
||||
import {get as getProjection} from '../proj.js';
|
||||
import SourceState from '../source/State.js';
|
||||
@@ -89,7 +90,7 @@ Source.prototype.adaptAttributions_ = function(attributionLike) {
|
||||
* @return {T|undefined} Callback result.
|
||||
* @template T
|
||||
*/
|
||||
Source.prototype.forEachFeatureAtCoordinate = nullFunction;
|
||||
Source.prototype.forEachFeatureAtCoordinate = UNDEFINED;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/**
|
||||
* @module ol/source/Tile
|
||||
*/
|
||||
import {inherits, nullFunction} from '../index.js';
|
||||
import {inherits} from '../index.js';
|
||||
import {UNDEFINED} from '../functions.js';
|
||||
import TileCache from '../TileCache.js';
|
||||
import TileState from '../TileState.js';
|
||||
import Event from '../events/Event.js';
|
||||
@@ -303,7 +304,7 @@ TileSource.prototype.refresh = function() {
|
||||
* @param {number} y Tile coordinate y.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
*/
|
||||
TileSource.prototype.useTile = nullFunction;
|
||||
TileSource.prototype.useTile = UNDEFINED;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @module ol/source/Vector
|
||||
*/
|
||||
|
||||
import {getUid, inherits, nullFunction} from '../index.js';
|
||||
import {getUid, inherits} from '../index.js';
|
||||
import Collection from '../Collection.js';
|
||||
import CollectionEventType from '../CollectionEventType.js';
|
||||
import ObjectEventType from '../ObjectEventType.js';
|
||||
@@ -13,7 +13,7 @@ import Event from '../events/Event.js';
|
||||
import EventType from '../events/EventType.js';
|
||||
import {containsExtent, equals} from '../extent.js';
|
||||
import {xhr} from '../featureloader.js';
|
||||
import {TRUE} from '../functions.js';
|
||||
import {TRUE, UNDEFINED} from '../functions.js';
|
||||
import {all as allStrategy} from '../loadingstrategy.js';
|
||||
import {isEmpty, getValues} from '../obj.js';
|
||||
import Source from '../source/Source.js';
|
||||
@@ -75,7 +75,7 @@ const VectorSource = function(opt_options) {
|
||||
* @private
|
||||
* @type {ol.FeatureLoader}
|
||||
*/
|
||||
this.loader_ = nullFunction;
|
||||
this.loader_ = UNDEFINED;
|
||||
|
||||
/**
|
||||
* @private
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/**
|
||||
* @module ol/style/AtlasManager
|
||||
*/
|
||||
import {WEBGL_MAX_TEXTURE_SIZE, nullFunction} from '../index.js';
|
||||
import {WEBGL_MAX_TEXTURE_SIZE} from '../index.js';
|
||||
import {UNDEFINED} from '../functions.js';
|
||||
import Atlas from '../style/Atlas.js';
|
||||
|
||||
|
||||
@@ -180,7 +181,7 @@ AtlasManager.prototype.add = function(id, width, height,
|
||||
// the hit-detection atlas, to make sure that the offset is the same for
|
||||
// the original image and the hit-detection image.
|
||||
const renderHitCallback = opt_renderHitCallback !== undefined ?
|
||||
opt_renderHitCallback : nullFunction;
|
||||
opt_renderHitCallback : UNDEFINED;
|
||||
|
||||
const hitInfo = /** @type {ol.AtlasInfo} */ (this.add_(true,
|
||||
id, width, height, renderHitCallback, opt_this));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {nullFunction} from '../../../../src/ol/index.js';
|
||||
import {UNDEFINED} from '../../../../src/ol/functions.js';
|
||||
import {getListeners} from '../../../../src/ol/events.js';
|
||||
import LineString from '../../../../src/ol/geom/LineString.js';
|
||||
import Point from '../../../../src/ol/geom/Point.js';
|
||||
@@ -77,7 +77,7 @@ describe('ol.renderer.vector', function() {
|
||||
const imageReplay = replayGroup.getReplay(
|
||||
style.getZIndex(), 'Image');
|
||||
const setImageStyleSpy = sinon.spy(imageReplay, 'setImageStyle');
|
||||
const drawPointSpy = sinon.stub(imageReplay, 'drawPoint').callsFake(nullFunction);
|
||||
const drawPointSpy = sinon.stub(imageReplay, 'drawPoint').callsFake(UNDEFINED);
|
||||
renderFeature(replayGroup, feature,
|
||||
style, squaredTolerance, listener, listenerThis);
|
||||
expect(setImageStyleSpy.called).to.be(false);
|
||||
@@ -90,7 +90,7 @@ describe('ol.renderer.vector', function() {
|
||||
const imageReplay = replayGroup.getReplay(
|
||||
style.getZIndex(), 'Image');
|
||||
const setImageStyleSpy = sinon.spy(imageReplay, 'setImageStyle');
|
||||
const drawMultiPointSpy = sinon.stub(imageReplay, 'drawMultiPoint').callsFake(nullFunction);
|
||||
const drawMultiPointSpy = sinon.stub(imageReplay, 'drawMultiPoint').callsFake(UNDEFINED);
|
||||
renderFeature(replayGroup, feature,
|
||||
style, squaredTolerance, listener, listenerThis);
|
||||
expect(setImageStyleSpy.called).to.be(false);
|
||||
@@ -104,7 +104,7 @@ describe('ol.renderer.vector', function() {
|
||||
style.getZIndex(), 'LineString');
|
||||
const setFillStrokeStyleSpy = sinon.spy(lineStringReplay,
|
||||
'setFillStrokeStyle');
|
||||
const drawLineStringSpy = sinon.stub(lineStringReplay, 'drawLineString').callsFake(nullFunction);
|
||||
const drawLineStringSpy = sinon.stub(lineStringReplay, 'drawLineString').callsFake(UNDEFINED);
|
||||
renderFeature(replayGroup, feature,
|
||||
style, squaredTolerance, listener, listenerThis);
|
||||
expect(setFillStrokeStyleSpy.called).to.be(true);
|
||||
@@ -119,7 +119,7 @@ describe('ol.renderer.vector', function() {
|
||||
style.getZIndex(), 'LineString');
|
||||
const setFillStrokeStyleSpy = sinon.spy(lineStringReplay,
|
||||
'setFillStrokeStyle');
|
||||
const drawMultiLineStringSpy = sinon.stub(lineStringReplay, 'drawMultiLineString').callsFake(nullFunction);
|
||||
const drawMultiLineStringSpy = sinon.stub(lineStringReplay, 'drawMultiLineString').callsFake(UNDEFINED);
|
||||
renderFeature(replayGroup, feature,
|
||||
style, squaredTolerance, listener, listenerThis);
|
||||
expect(setFillStrokeStyleSpy.called).to.be(true);
|
||||
@@ -135,7 +135,7 @@ describe('ol.renderer.vector', function() {
|
||||
style.getZIndex(), 'Polygon');
|
||||
const setFillStrokeStyleSpy = sinon.spy(polygonReplay,
|
||||
'setFillStrokeStyle');
|
||||
const drawPolygonSpy = sinon.stub(polygonReplay, 'drawPolygon').callsFake(nullFunction);
|
||||
const drawPolygonSpy = sinon.stub(polygonReplay, 'drawPolygon').callsFake(UNDEFINED);
|
||||
renderFeature(replayGroup, feature,
|
||||
style, squaredTolerance, listener, listenerThis);
|
||||
expect(setFillStrokeStyleSpy.called).to.be(true);
|
||||
@@ -151,7 +151,7 @@ describe('ol.renderer.vector', function() {
|
||||
style.getZIndex(), 'Polygon');
|
||||
const setFillStrokeStyleSpy = sinon.spy(polygonReplay,
|
||||
'setFillStrokeStyle');
|
||||
const drawMultiPolygonSpy = sinon.stub(polygonReplay, 'drawMultiPolygon').callsFake(nullFunction);
|
||||
const drawMultiPolygonSpy = sinon.stub(polygonReplay, 'drawMultiPolygon').callsFake(UNDEFINED);
|
||||
renderFeature(replayGroup, feature,
|
||||
style, squaredTolerance, listener, listenerThis);
|
||||
expect(setFillStrokeStyleSpy.called).to.be(true);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {nullFunction} from '../../../../src/ol/index.js';
|
||||
import {UNDEFINED} from '../../../../src/ol/functions.js';
|
||||
import {listen} from '../../../../src/ol/events.js';
|
||||
import {iconImageCache} from '../../../../src/ol/style.js';
|
||||
import IconImage from '../../../../src/ol/style/IconImage.js';
|
||||
@@ -42,13 +42,13 @@ describe('ol.style.IconImageCache', function() {
|
||||
|
||||
src = '0';
|
||||
iconImage = new IconImage(null, src);
|
||||
listen(iconImage, 'change', nullFunction, false);
|
||||
listen(iconImage, 'change', UNDEFINED, false);
|
||||
iconImageCache.set(src, null, null, iconImage);
|
||||
expect(iconImageCache.cacheSize_).to.eql(4);
|
||||
|
||||
src = '4';
|
||||
iconImage = new IconImage(null, src);
|
||||
listen(iconImage, 'change', nullFunction, false);
|
||||
listen(iconImage, 'change', UNDEFINED, false);
|
||||
iconImageCache.set(src, null, null, iconImage);
|
||||
expect(iconImageCache.cacheSize_).to.eql(5);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user