Rename extent
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import Map from '../../../../src/ol/Map.js';
|
||||
import View from '../../../../src/ol/View.js';
|
||||
import * as _ol_extent_ from '../../../../src/ol/extent.js';
|
||||
import {getSize} from '../../../../src/ol/extent.js';
|
||||
import Point from '../../../../src/ol/geom/Point.js';
|
||||
import TileLayer from '../../../../src/ol/layer/Tile.js';
|
||||
import {assign} from '../../../../src/ol/obj.js';
|
||||
@@ -146,8 +146,8 @@ describe('ol.rendering.layer.Tile', function() {
|
||||
|
||||
function centerExtent(map) {
|
||||
const c = map.getView().calculateExtent(map.getSize());
|
||||
const qw = _ol_extent_.getSize(c)[0] / 4;
|
||||
const qh = _ol_extent_.getSize(c)[1] / 4;
|
||||
const qw = getSize(c)[0] / 4;
|
||||
const qh = getSize(c)[1] / 4;
|
||||
return [c[0] + qw, c[1] + qh, c[2] - qw, c[3] - qh];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Feature from '../../../../src/ol/Feature.js';
|
||||
import * as _ol_extent_ from '../../../../src/ol/extent.js';
|
||||
import {equals} from '../../../../src/ol/extent.js';
|
||||
import EsriJSON from '../../../../src/ol/format/EsriJSON.js';
|
||||
import LineString from '../../../../src/ol/geom/LineString.js';
|
||||
import LinearRing from '../../../../src/ol/geom/LinearRing.js';
|
||||
@@ -305,7 +305,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
expect(first.getId()).to.be(6406);
|
||||
const firstGeom = first.getGeometry();
|
||||
expect(firstGeom).to.be.a(Polygon);
|
||||
expect(_ol_extent_.equals(firstGeom.getExtent(), [
|
||||
expect(equals(firstGeom.getExtent(), [
|
||||
-10585772.743554419, 4712365.161160459,
|
||||
-10579560.16462974, 4716567.373073828
|
||||
])).to.be(true);
|
||||
@@ -316,7 +316,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
expect(last.getId()).to.be(6030);
|
||||
const lastGeom = last.getGeometry();
|
||||
expect(lastGeom).to.be.a(Polygon);
|
||||
expect(_ol_extent_.equals(lastGeom.getExtent(), [
|
||||
expect(equals(lastGeom.getExtent(), [
|
||||
-10555714.026858449, 4576511.565880965,
|
||||
-10553671.199322715, 4578554.9934867555
|
||||
])).to.be(true);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Feature from '../../../../src/ol/Feature.js';
|
||||
import * as _ol_extent_ from '../../../../src/ol/extent.js';
|
||||
import {equals} from '../../../../src/ol/extent.js';
|
||||
import GeoJSON from '../../../../src/ol/format/GeoJSON.js';
|
||||
import Circle from '../../../../src/ol/geom/Circle.js';
|
||||
import GeometryCollection from '../../../../src/ol/geom/GeometryCollection.js';
|
||||
@@ -302,7 +302,7 @@ describe('ol.format.GeoJSON', function() {
|
||||
expect(first.getId()).to.be('AFG');
|
||||
const firstGeom = first.getGeometry();
|
||||
expect(firstGeom).to.be.a(Polygon);
|
||||
expect(_ol_extent_.equals(firstGeom.getExtent(),
|
||||
expect(equals(firstGeom.getExtent(),
|
||||
[60.52843, 29.318572, 75.158028, 38.486282]))
|
||||
.to.be(true);
|
||||
|
||||
@@ -312,7 +312,7 @@ describe('ol.format.GeoJSON', function() {
|
||||
expect(last.getId()).to.be('ZWE');
|
||||
const lastGeom = last.getGeometry();
|
||||
expect(lastGeom).to.be.a(Polygon);
|
||||
expect(_ol_extent_.equals(lastGeom.getExtent(),
|
||||
expect(equals(lastGeom.getExtent(),
|
||||
[25.264226, -22.271612, 32.849861, -15.507787]))
|
||||
.to.be(true);
|
||||
done();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Feature from '../../../../src/ol/Feature.js';
|
||||
import * as _ol_extent_ from '../../../../src/ol/extent.js';
|
||||
import {getWidth} from '../../../../src/ol/extent.js';
|
||||
import MVT from '../../../../src/ol/format/MVT.js';
|
||||
import Point from '../../../../src/ol/geom/Point.js';
|
||||
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
||||
@@ -78,7 +78,7 @@ where('ArrayBuffer.isView').describe('ol.format.MVT', function() {
|
||||
const format = new MVT();
|
||||
format.readFeatures(data);
|
||||
const extent = format.getLastExtent();
|
||||
expect(_ol_extent_.getWidth(extent)).to.be(4096);
|
||||
expect(getWidth(extent)).to.be(4096);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as _ol_extent_ from '../../../../src/ol/extent.js';
|
||||
import {isEmpty} from '../../../../src/ol/extent.js';
|
||||
import LineString from '../../../../src/ol/geom/LineString.js';
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ describe('ol.geom.LineString', function() {
|
||||
});
|
||||
|
||||
it('has an empty extent', function() {
|
||||
expect(_ol_extent_.isEmpty(lineString.getExtent())).to.be(true);
|
||||
expect(isEmpty(lineString.getExtent())).to.be(true);
|
||||
});
|
||||
|
||||
it('has empty flat coordinates', function() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as _ol_extent_ from '../../../../src/ol/extent.js';
|
||||
import {isEmpty} from '../../../../src/ol/extent.js';
|
||||
import LineString from '../../../../src/ol/geom/LineString.js';
|
||||
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
|
||||
|
||||
@@ -27,7 +27,7 @@ describe('ol.geom.MultiLineString', function() {
|
||||
});
|
||||
|
||||
it('has an empty extent', function() {
|
||||
expect(_ol_extent_.isEmpty(multiLineString.getExtent())).to.be(true);
|
||||
expect(isEmpty(multiLineString.getExtent())).to.be(true);
|
||||
});
|
||||
|
||||
it('has empty flat coordinates', function() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as _ol_extent_ from '../../../../src/ol/extent.js';
|
||||
import {isEmpty} from '../../../../src/ol/extent.js';
|
||||
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
|
||||
import Point from '../../../../src/ol/geom/Point.js';
|
||||
|
||||
@@ -27,7 +27,7 @@ describe('ol.geom.MultiPoint', function() {
|
||||
});
|
||||
|
||||
it('has an empty extent', function() {
|
||||
expect(_ol_extent_.isEmpty(multiPoint.getExtent())).to.be(true);
|
||||
expect(isEmpty(multiPoint.getExtent())).to.be(true);
|
||||
});
|
||||
|
||||
it('has empty flat coordinates', function() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import * as _ol_extent_ from '../../../../src/ol/extent.js';
|
||||
import {isEmpty, boundingExtent} from '../../../../src/ol/extent.js';
|
||||
import Circle from '../../../../src/ol/geom/Circle.js';
|
||||
import LinearRing from '../../../../src/ol/geom/LinearRing.js';
|
||||
import Polygon, {fromCircle, fromExtent} from '../../../../src/ol/geom/Polygon.js';
|
||||
@@ -28,7 +28,7 @@ describe('ol/geom/Polygon', function() {
|
||||
});
|
||||
|
||||
it('has an empty extent', function() {
|
||||
expect(_ol_extent_.isEmpty(polygon.getExtent())).to.be(true);
|
||||
expect(isEmpty(polygon.getExtent())).to.be(true);
|
||||
});
|
||||
|
||||
it('has empty flat coordinates', function() {
|
||||
@@ -221,25 +221,25 @@ describe('ol/geom/Polygon', function() {
|
||||
|
||||
it('does not intersect outside extent', function() {
|
||||
expect(polygon.intersectsExtent(
|
||||
_ol_extent_.boundingExtent([outsideOuter]))).to.be(false);
|
||||
boundingExtent([outsideOuter]))).to.be(false);
|
||||
});
|
||||
|
||||
it('does intersect inside extent', function() {
|
||||
expect(polygon.intersectsExtent(
|
||||
_ol_extent_.boundingExtent([inside]))).to.be(true);
|
||||
boundingExtent([inside]))).to.be(true);
|
||||
});
|
||||
|
||||
it('does intersect boundary extent', function() {
|
||||
const firstMidX = (outerRing[0][0] + outerRing[1][0]) / 2;
|
||||
const firstMidY = (outerRing[0][1] + outerRing[1][1]) / 2;
|
||||
|
||||
expect(polygon.intersectsExtent(_ol_extent_.boundingExtent([[firstMidX,
|
||||
expect(polygon.intersectsExtent(boundingExtent([[firstMidX,
|
||||
firstMidY]]))).to.be(true);
|
||||
});
|
||||
|
||||
it('does not intersect extent fully contained by inner ring', function() {
|
||||
expect(polygon.intersectsExtent(
|
||||
_ol_extent_.boundingExtent([insideInner]))).to.be(false);
|
||||
boundingExtent([insideInner]))).to.be(false);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -320,25 +320,25 @@ describe('ol/geom/Polygon', function() {
|
||||
|
||||
it('does not intersect outside extent', function() {
|
||||
expect(polygon.intersectsExtent(
|
||||
_ol_extent_.boundingExtent([outsideOuter]))).to.be(false);
|
||||
boundingExtent([outsideOuter]))).to.be(false);
|
||||
});
|
||||
|
||||
it('does intersect inside extent', function() {
|
||||
expect(polygon.intersectsExtent(
|
||||
_ol_extent_.boundingExtent([inside]))).to.be(true);
|
||||
boundingExtent([inside]))).to.be(true);
|
||||
});
|
||||
|
||||
it('does intersect boundary extent', function() {
|
||||
const firstMidX = (outerRing[0][0] + outerRing[1][0]) / 2;
|
||||
const firstMidY = (outerRing[0][1] + outerRing[1][1]) / 2;
|
||||
|
||||
expect(polygon.intersectsExtent(_ol_extent_.boundingExtent([[firstMidX,
|
||||
expect(polygon.intersectsExtent(boundingExtent([[firstMidX,
|
||||
firstMidY]]))).to.be(true);
|
||||
});
|
||||
|
||||
it('does not intersect extent fully contained by inner ring', function() {
|
||||
expect(polygon.intersectsExtent(
|
||||
_ol_extent_.boundingExtent([insideInner]))).to.be(false);
|
||||
boundingExtent([insideInner]))).to.be(false);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -427,27 +427,27 @@ describe('ol/geom/Polygon', function() {
|
||||
|
||||
it('does not intersect outside extent', function() {
|
||||
expect(polygon.intersectsExtent(
|
||||
_ol_extent_.boundingExtent([outsideOuter]))).to.be(false);
|
||||
boundingExtent([outsideOuter]))).to.be(false);
|
||||
});
|
||||
|
||||
it('does intersect inside extent', function() {
|
||||
expect(polygon.intersectsExtent(
|
||||
_ol_extent_.boundingExtent([inside]))).to.be(true);
|
||||
boundingExtent([inside]))).to.be(true);
|
||||
});
|
||||
|
||||
it('does intersect boundary extent', function() {
|
||||
const firstMidX = (outerRing[0][0] + outerRing[1][0]) / 2;
|
||||
const firstMidY = (outerRing[0][1] + outerRing[1][1]) / 2;
|
||||
|
||||
expect(polygon.intersectsExtent(_ol_extent_.boundingExtent([[firstMidX,
|
||||
expect(polygon.intersectsExtent(boundingExtent([[firstMidX,
|
||||
firstMidY]]))).to.be(true);
|
||||
});
|
||||
|
||||
it('does not intersect extent fully contained by inner ring', function() {
|
||||
expect(polygon.intersectsExtent(
|
||||
_ol_extent_.boundingExtent([insideInner1]))).to.be(false);
|
||||
boundingExtent([insideInner1]))).to.be(false);
|
||||
expect(polygon.intersectsExtent(
|
||||
_ol_extent_.boundingExtent([insideInner2]))).to.be(false);
|
||||
boundingExtent([insideInner2]))).to.be(false);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Map from '../../../../src/ol/Map.js';
|
||||
import View from '../../../../src/ol/View.js';
|
||||
import * as _ol_extent_ from '../../../../src/ol/extent.js';
|
||||
import {getCenter} from '../../../../src/ol/extent.js';
|
||||
import {fromExtent as polygonFromExtent} from '../../../../src/ol/geom/Polygon.js';
|
||||
import DragZoom from '../../../../src/ol/interaction/DragZoom.js';
|
||||
import VectorLayer from '../../../../src/ol/layer/Vector.js';
|
||||
@@ -79,7 +79,7 @@ describe('ol.interaction.DragZoom', function() {
|
||||
setTimeout(function() {
|
||||
const view = map.getView();
|
||||
const center = view.getCenter();
|
||||
expect(center).to.eql(_ol_extent_.getCenter(extent));
|
||||
expect(center).to.eql(getCenter(extent));
|
||||
done();
|
||||
}, 50);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {getUid} from '../../../../src/ol/index.js';
|
||||
import {stableSort} from '../../../../src/ol/array.js';
|
||||
import Collection from '../../../../src/ol/Collection.js';
|
||||
import * as _ol_extent_ from '../../../../src/ol/extent.js';
|
||||
import {getIntersection} 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';
|
||||
@@ -403,7 +403,7 @@ describe('ol.layer.Group', function() {
|
||||
});
|
||||
const layerStatesArray = layerGroup.getLayerStatesArray();
|
||||
expect(layerStatesArray[0].extent).to.eql(
|
||||
_ol_extent_.getIntersection(layer3.getExtent(), groupExtent));
|
||||
getIntersection(layer3.getExtent(), groupExtent));
|
||||
layerGroup.dispose();
|
||||
});
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import {getUid} from '../../../../../src/ol/index.js';
|
||||
import Feature from '../../../../../src/ol/Feature.js';
|
||||
import Map from '../../../../../src/ol/Map.js';
|
||||
import View from '../../../../../src/ol/View.js';
|
||||
import * as _ol_extent_ from '../../../../../src/ol/extent.js';
|
||||
import {buffer as bufferExtent, getWidth} from '../../../../../src/ol/extent.js';
|
||||
import Point from '../../../../../src/ol/geom/Point.js';
|
||||
import VectorLayer from '../../../../../src/ol/layer/Vector.js';
|
||||
import {clear} from '../../../../../src/ol/obj.js';
|
||||
@@ -228,7 +228,7 @@ describe('ol.renderer.canvas.VectorLayer', function() {
|
||||
renderer = new CanvasVectorLayerRenderer(layer);
|
||||
const projection = getProjection('EPSG:3857');
|
||||
projExtent = projection.getExtent();
|
||||
worldWidth = _ol_extent_.getWidth(projExtent);
|
||||
worldWidth = getWidth(projExtent);
|
||||
buffer = layer.getRenderBuffer();
|
||||
frameState = {
|
||||
skippedFeatureUids: {},
|
||||
@@ -246,7 +246,7 @@ describe('ol.renderer.canvas.VectorLayer', function() {
|
||||
frameState.extent =
|
||||
[projExtent[0] - 10000, -10000, projExtent[0] + 10000, 10000];
|
||||
renderer.prepareFrame(frameState, {});
|
||||
expect(renderer.replayGroup_.maxExtent_).to.eql(_ol_extent_.buffer([
|
||||
expect(renderer.replayGroup_.maxExtent_).to.eql(bufferExtent([
|
||||
projExtent[0] - worldWidth + buffer,
|
||||
-10000, projExtent[2] + worldWidth - buffer, 10000
|
||||
], buffer));
|
||||
@@ -258,7 +258,7 @@ describe('ol.renderer.canvas.VectorLayer', function() {
|
||||
frameState.extent =
|
||||
[projExtent[0] - 10000, -10000, projExtent[1] - 10000, 10000];
|
||||
renderer.prepareFrame(frameState, {});
|
||||
expect(renderer.replayGroup_.maxExtent_).to.eql(_ol_extent_.buffer([
|
||||
expect(renderer.replayGroup_.maxExtent_).to.eql(bufferExtent([
|
||||
projExtent[0] - worldWidth + buffer,
|
||||
-10000, projExtent[2] + worldWidth - buffer, 10000
|
||||
], buffer));
|
||||
@@ -269,7 +269,7 @@ describe('ol.renderer.canvas.VectorLayer', function() {
|
||||
frameState.extent =
|
||||
[2 * projExtent[0] - 10000, -10000, 2 * projExtent[1] + 10000, 10000];
|
||||
renderer.prepareFrame(frameState, {});
|
||||
expect(renderer.replayGroup_.maxExtent_).to.eql(_ol_extent_.buffer([
|
||||
expect(renderer.replayGroup_.maxExtent_).to.eql(bufferExtent([
|
||||
projExtent[0] - worldWidth + buffer,
|
||||
-10000, projExtent[2] + worldWidth - buffer, 10000
|
||||
], buffer));
|
||||
@@ -282,7 +282,7 @@ describe('ol.renderer.canvas.VectorLayer', function() {
|
||||
-10000, projExtent[1] + 2 * worldWidth + 10000, 10000
|
||||
];
|
||||
renderer.prepareFrame(frameState, {});
|
||||
expect(renderer.replayGroup_.maxExtent_).to.eql(_ol_extent_.buffer([
|
||||
expect(renderer.replayGroup_.maxExtent_).to.eql(bufferExtent([
|
||||
projExtent[0] - 2 * worldWidth - 10000,
|
||||
-10000, projExtent[2] + 2 * worldWidth + 10000, 10000
|
||||
], buffer));
|
||||
|
||||
@@ -6,7 +6,7 @@ import TileState from '../../../../../src/ol/TileState.js';
|
||||
import VectorImageTile from '../../../../../src/ol/VectorImageTile.js';
|
||||
import VectorTile from '../../../../../src/ol/VectorTile.js';
|
||||
import View from '../../../../../src/ol/View.js';
|
||||
import * as _ol_extent_ from '../../../../../src/ol/extent.js';
|
||||
import {getCenter} from '../../../../../src/ol/extent.js';
|
||||
import MVT from '../../../../../src/ol/format/MVT.js';
|
||||
import Point from '../../../../../src/ol/geom/Point.js';
|
||||
import VectorTileLayer from '../../../../../src/ol/layer/VectorTile.js';
|
||||
@@ -364,7 +364,7 @@ describe('ol.renderer.canvas.VectorTileLayer', function() {
|
||||
})
|
||||
],
|
||||
view: new View({
|
||||
center: _ol_extent_.getCenter(extent),
|
||||
center: getCenter(extent),
|
||||
zoom: 19
|
||||
})
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {DEFAULT_MAX_ZOOM, DEFAULT_TILE_SIZE} from '../../../../src/ol/tilegrid/common.js';
|
||||
import TileRange from '../../../../src/ol/TileRange.js';
|
||||
import * as _ol_extent_ from '../../../../src/ol/extent.js';
|
||||
import {createOrUpdate} from '../../../../src/ol/extent.js';
|
||||
import {get as getProjection, METERS_PER_UNIT} from '../../../../src/ol/proj.js';
|
||||
import {HALF_SIZE} from '../../../../src/ol/proj/epsg3857.js';
|
||||
import Projection from '../../../../src/ol/proj/Projection.js';
|
||||
@@ -275,7 +275,7 @@ describe('ol.tilegrid.TileGrid', function() {
|
||||
|
||||
describe('createForExtent', function() {
|
||||
it('allows creation of tile grid from extent', function() {
|
||||
const extent = _ol_extent_.createOrUpdate(-100, -100, 100, 100);
|
||||
const extent = createOrUpdate(-100, -100, 100, 100);
|
||||
const grid = createForExtent(extent);
|
||||
expect(grid).to.be.a(TileGrid);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Map from '../../../src/ol/Map.js';
|
||||
import View, {createCenterConstraint, createResolutionConstraint, createRotationConstraint} from '../../../src/ol/View.js';
|
||||
import ViewHint from '../../../src/ol/ViewHint.js';
|
||||
import * as _ol_extent_ from '../../../src/ol/extent.js';
|
||||
import {createEmpty} from '../../../src/ol/extent.js';
|
||||
import Circle from '../../../src/ol/geom/Circle.js';
|
||||
import LineString from '../../../src/ol/geom/LineString.js';
|
||||
import Point from '../../../src/ol/geom/Point.js';
|
||||
@@ -1348,7 +1348,7 @@ describe('ol.View', function() {
|
||||
});
|
||||
it('throws on empty extent', function() {
|
||||
expect(function() {
|
||||
view.fit(_ol_extent_.createEmpty());
|
||||
view.fit(createEmpty());
|
||||
}).to.throwException();
|
||||
});
|
||||
it('animates when duration is defined', function(done) {
|
||||
|
||||
Reference in New Issue
Block a user