Merge pull request #7823 from fredj/f7801
Replace static members with named exports
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import Feature from '../../../src/ol/Feature.js';
|
||||
import Feature, {createStyleFunction} from '../../../src/ol/Feature.js';
|
||||
import Point from '../../../src/ol/geom/Point.js';
|
||||
import {isEmpty} from '../../../src/ol/obj.js';
|
||||
import Style from '../../../src/ol/style/Style.js';
|
||||
@@ -441,12 +441,12 @@ describe('ol.Feature.createStyleFunction()', function() {
|
||||
const style = new Style();
|
||||
|
||||
it('creates a feature style function from a single style', function() {
|
||||
const styleFunction = Feature.createStyleFunction(style);
|
||||
const styleFunction = createStyleFunction(style);
|
||||
expect(styleFunction()).to.eql([style]);
|
||||
});
|
||||
|
||||
it('creates a feature style function from an array of styles', function() {
|
||||
const styleFunction = Feature.createStyleFunction([style]);
|
||||
const styleFunction = createStyleFunction([style]);
|
||||
expect(styleFunction()).to.eql([style]);
|
||||
});
|
||||
|
||||
@@ -454,13 +454,13 @@ describe('ol.Feature.createStyleFunction()', function() {
|
||||
const original = function(feature, resolution) {
|
||||
return [style];
|
||||
};
|
||||
const styleFunction = Feature.createStyleFunction(original);
|
||||
const styleFunction = createStyleFunction(original);
|
||||
expect(styleFunction).to.be(original);
|
||||
});
|
||||
|
||||
it('throws on (some) unexpected input', function() {
|
||||
expect(function() {
|
||||
Feature.createStyleFunction({bogus: 'input'});
|
||||
createStyleFunction({bogus: 'input'});
|
||||
}).to.throwException();
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Feature from '../../../../src/ol/Feature.js';
|
||||
import GML2 from '../../../../src/ol/format/GML2.js';
|
||||
import WFS from '../../../../src/ol/format/WFS.js';
|
||||
import WFS, {writeFilter} from '../../../../src/ol/format/WFS.js';
|
||||
import {
|
||||
and as andFilter,
|
||||
bbox as bboxFilter,
|
||||
@@ -1314,7 +1314,7 @@ describe('ol.format.WFS', function() {
|
||||
' </PropertyIsEqualTo>' +
|
||||
' </And>' +
|
||||
'</Filter>';
|
||||
const serialized = WFS.writeFilter(
|
||||
const serialized = writeFilter(
|
||||
andFilter(
|
||||
likeFilter('name', 'Mississippi*'),
|
||||
equalToFilter('waterway', 'riverbank')
|
||||
|
||||
@@ -5,7 +5,7 @@ import * as _ol_extent_ from '../../../../src/ol/extent.js';
|
||||
import LayerGroup from '../../../../src/ol/layer/Group.js';
|
||||
import Layer from '../../../../src/ol/layer/Layer.js';
|
||||
import {assign} from '../../../../src/ol/obj.js';
|
||||
import MapRenderer from '../../../../src/ol/renderer/Map.js';
|
||||
import {sortByZIndex} from '../../../../src/ol/renderer/Map.js';
|
||||
import Source from '../../../../src/ol/source/Source.js';
|
||||
|
||||
|
||||
@@ -451,7 +451,7 @@ describe('ol.layer.Group', function() {
|
||||
|
||||
const layerStatesArray = layerGroup.getLayerStatesArray();
|
||||
const initialArray = layerStatesArray.slice();
|
||||
stableSort(layerStatesArray, MapRenderer.sortByZIndex);
|
||||
stableSort(layerStatesArray, sortByZIndex);
|
||||
expect(layerStatesArray[0]).to.eql(initialArray[0]);
|
||||
expect(layerStatesArray[1]).to.eql(initialArray[1]);
|
||||
|
||||
@@ -479,7 +479,7 @@ describe('ol.layer.Group', function() {
|
||||
|
||||
const layerStatesArray = layerGroup.getLayerStatesArray();
|
||||
const initialArray = layerStatesArray.slice();
|
||||
stableSort(layerStatesArray, MapRenderer.sortByZIndex);
|
||||
stableSort(layerStatesArray, sortByZIndex);
|
||||
expect(layerStatesArray[0]).to.eql(initialArray[3]);
|
||||
expect(layerStatesArray[1]).to.eql(initialArray[0]);
|
||||
expect(layerStatesArray[2]).to.eql(initialArray[2]);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {getUid} from '../../../../src/ol/index.js';
|
||||
import Map from '../../../../src/ol/Map.js';
|
||||
import Layer from '../../../../src/ol/layer/Layer.js';
|
||||
import Layer, {visibleAtResolution} from '../../../../src/ol/layer/Layer.js';
|
||||
import {get as getProjection} from '../../../../src/ol/proj.js';
|
||||
import RenderEvent from '../../../../src/ol/render/Event.js';
|
||||
import Source from '../../../../src/ol/source/Source.js';
|
||||
@@ -117,7 +117,7 @@ describe('ol.layer.Layer', function() {
|
||||
layer.setMinResolution(3);
|
||||
layer.setMaxResolution(5);
|
||||
const layerState = layer.getLayerState();
|
||||
expect(Layer.visibleAtResolution(layerState, 4)).to.be(false);
|
||||
expect(visibleAtResolution(layerState, 4)).to.be(false);
|
||||
});
|
||||
|
||||
it('returns false if resolution lower than minResolution', function() {
|
||||
@@ -125,7 +125,7 @@ describe('ol.layer.Layer', function() {
|
||||
layer.setMinResolution(3);
|
||||
layer.setMaxResolution(5);
|
||||
const layerState = layer.getLayerState();
|
||||
expect(Layer.visibleAtResolution(layerState, 2)).to.be(false);
|
||||
expect(visibleAtResolution(layerState, 2)).to.be(false);
|
||||
});
|
||||
|
||||
it('returns false if resolution greater than maxResolution', function() {
|
||||
@@ -133,7 +133,7 @@ describe('ol.layer.Layer', function() {
|
||||
layer.setMinResolution(3);
|
||||
layer.setMaxResolution(5);
|
||||
const layerState = layer.getLayerState();
|
||||
expect(Layer.visibleAtResolution(layerState, 6)).to.be(false);
|
||||
expect(visibleAtResolution(layerState, 6)).to.be(false);
|
||||
});
|
||||
|
||||
it('returns true otherwise', function() {
|
||||
@@ -141,7 +141,7 @@ describe('ol.layer.Layer', function() {
|
||||
layer.setMinResolution(3);
|
||||
layer.setMaxResolution(5);
|
||||
const layerState = layer.getLayerState();
|
||||
expect(Layer.visibleAtResolution(layerState, 4)).to.be(true);
|
||||
expect(visibleAtResolution(layerState, 4)).to.be(true);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user