Remove lint
This commit is contained in:
@@ -86,19 +86,13 @@ describe('ol.color', function () {
|
||||
expect(fromString('rgba(255, 255, 0, 0.0)')).to.eql([255, 255, 0, 0]);
|
||||
// opacity 0.0000000000000000 (float with 16 digits)
|
||||
expect(fromString('rgba(255, 255, 0, 0.0000000000000000)')).to.eql([
|
||||
255,
|
||||
255,
|
||||
0,
|
||||
0,
|
||||
255, 255, 0, 0,
|
||||
]);
|
||||
// opacity 0.1 (simple float)
|
||||
expect(fromString('rgba(255, 255, 0, 0.1)')).to.eql([255, 255, 0, 0.1]);
|
||||
// opacity 0.1111111111111111 (float with 16 digits)
|
||||
expect(fromString('rgba(255, 255, 0, 0.1111111111111111)')).to.eql([
|
||||
255,
|
||||
255,
|
||||
0,
|
||||
0.1111111111111111,
|
||||
255, 255, 0, 0.1111111111111111,
|
||||
]);
|
||||
// opacity 1
|
||||
expect(fromString('rgba(255, 255, 0, 1)')).to.eql([255, 255, 0, 1]);
|
||||
@@ -106,10 +100,7 @@ describe('ol.color', function () {
|
||||
expect(fromString('rgba(255, 255, 0, 1.0)')).to.eql([255, 255, 0, 1]);
|
||||
// opacity 1.0000000000000000
|
||||
expect(fromString('rgba(255, 255, 0, 1.0000000000000000)')).to.eql([
|
||||
255,
|
||||
255,
|
||||
0,
|
||||
1,
|
||||
255, 255, 0, 1,
|
||||
]);
|
||||
// with 30 decimal digits
|
||||
expect(
|
||||
@@ -118,9 +109,9 @@ describe('ol.color', function () {
|
||||
});
|
||||
|
||||
it('ignores whitespace before, between & after numbers (rgba)', function () {
|
||||
expect(
|
||||
fromString('rgba( \t 0 , 0 \n , 255 , 0.4711 )')
|
||||
).to.eql([0, 0, 255, 0.4711]);
|
||||
expect(fromString('rgba( \t 0 , 0 \n , 255 , 0.4711 )')).to.eql(
|
||||
[0, 0, 255, 0.4711]
|
||||
);
|
||||
});
|
||||
|
||||
it('throws an error on invalid colors', function () {
|
||||
|
||||
@@ -47,9 +47,8 @@ describe('ol.control.ZoomSlider', function () {
|
||||
const zoomSliderContainer = zoomSliderContainers[0];
|
||||
expect(zoomSliderContainer instanceof HTMLDivElement).to.be(true);
|
||||
|
||||
let hasUnselectableCls = zoomSliderContainer.classList.contains(
|
||||
'ol-unselectable'
|
||||
);
|
||||
let hasUnselectableCls =
|
||||
zoomSliderContainer.classList.contains('ol-unselectable');
|
||||
expect(hasUnselectableCls).to.be(true);
|
||||
|
||||
const zoomSliderThumbs = zoomSliderContainer.querySelectorAll(
|
||||
@@ -60,9 +59,8 @@ describe('ol.control.ZoomSlider', function () {
|
||||
const zoomSliderThumb = zoomSliderThumbs[0];
|
||||
expect(zoomSliderThumb instanceof HTMLButtonElement).to.be(true);
|
||||
|
||||
hasUnselectableCls = zoomSliderThumb.classList.contains(
|
||||
'ol-unselectable'
|
||||
);
|
||||
hasUnselectableCls =
|
||||
zoomSliderThumb.classList.contains('ol-unselectable');
|
||||
expect(hasUnselectableCls).to.be(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1793,29 +1793,13 @@ describe('ol.format.GML3', function () {
|
||||
|
||||
it('creates 3D Features with the expected geometries', function () {
|
||||
const expectedGeometry1 = [
|
||||
4.46386854,
|
||||
51.91122415,
|
||||
46.04679351,
|
||||
4.46382399,
|
||||
51.91120839,
|
||||
4.46386854, 51.91122415, 46.04679351, 4.46382399, 51.91120839,
|
||||
46.04679382,
|
||||
];
|
||||
const expectedGeometry2 = [
|
||||
4.46385491,
|
||||
51.91119276,
|
||||
46.06074531,
|
||||
4.4638264,
|
||||
51.91118582,
|
||||
46.06074609,
|
||||
4.46380612,
|
||||
51.91121772,
|
||||
46.06074168,
|
||||
4.46383463,
|
||||
51.91122465,
|
||||
46.06074089,
|
||||
4.46385491,
|
||||
51.91119276,
|
||||
46.06074531,
|
||||
4.46385491, 51.91119276, 46.06074531, 4.4638264, 51.91118582,
|
||||
46.06074609, 4.46380612, 51.91121772, 46.06074168, 4.46383463,
|
||||
51.91122465, 46.06074089, 4.46385491, 51.91119276, 46.06074531,
|
||||
];
|
||||
const expectedGeometry3 = [4.46383715, 51.91125849, 46.04679348];
|
||||
|
||||
|
||||
@@ -22,9 +22,7 @@ where('ArrayBuffer.isView').describe('ol.format.MVT', function () {
|
||||
const options = {
|
||||
featureProjection: 'EPSG:3857',
|
||||
extent: [
|
||||
1824704.739223726,
|
||||
6141868.096770482,
|
||||
1827150.7241288517,
|
||||
1824704.739223726, 6141868.096770482, 1827150.7241288517,
|
||||
6144314.081675608,
|
||||
],
|
||||
};
|
||||
@@ -134,9 +132,7 @@ describe('ol.format.MVT', function () {
|
||||
const options = {
|
||||
featureProjection: 'EPSG:3857',
|
||||
extent: [
|
||||
1824704.739223726,
|
||||
6141868.096770482,
|
||||
1827150.7241288517,
|
||||
1824704.739223726, 6141868.096770482, 1827150.7241288517,
|
||||
6144314.081675608,
|
||||
],
|
||||
};
|
||||
|
||||
@@ -139,10 +139,7 @@ describe('ol.format.WFS', function () {
|
||||
expect(feature.getId()).to.equal('1');
|
||||
expect(feature.get('name')).to.equal('My Polygon with hole');
|
||||
expect(feature.get('boundedBy')).to.eql([
|
||||
47.003018,
|
||||
-0.768746,
|
||||
47.925567,
|
||||
0.532597,
|
||||
47.003018, -0.768746, 47.925567, 0.532597,
|
||||
]);
|
||||
expect(feature.getGeometry()).to.be.an(MultiPolygon);
|
||||
expect(feature.getGeometry().getFlatCoordinates()).to.have.length(60);
|
||||
@@ -205,10 +202,7 @@ describe('ol.format.WFS', function () {
|
||||
});
|
||||
it('returns the correct bounds', function () {
|
||||
expect(response.bounds).to.eql([
|
||||
3197.88,
|
||||
306457.313,
|
||||
280339.156,
|
||||
613850.438,
|
||||
3197.88, 306457.313, 280339.156, 613850.438,
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -117,10 +117,7 @@ describe('ol.format.WMSCapabilities', function () {
|
||||
},
|
||||
]);
|
||||
expect(layer.Layer[0].EX_GeographicBoundingBox).to.eql([
|
||||
-71.63,
|
||||
41.75,
|
||||
-70.78,
|
||||
42.9,
|
||||
-71.63, 41.75, -70.78, 42.9,
|
||||
]);
|
||||
expect(layer.Layer[0].Style).to.eql([
|
||||
{
|
||||
|
||||
@@ -55,10 +55,7 @@ describe('ol.format.WMSGetFeatureInfo', function () {
|
||||
const feature = features[0];
|
||||
expect(feature.getGeometry()).to.be(undefined);
|
||||
expect(feature.get('boundedBy')).to.eql([
|
||||
-531138.686422,
|
||||
5386348.414671,
|
||||
-117252.819653,
|
||||
6144475.186022,
|
||||
-531138.686422, 5386348.414671, -117252.819653, 6144475.186022,
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
@@ -19,9 +19,7 @@ describe('ol.layer.Graticule', function () {
|
||||
it('creates a graticule without labels', function () {
|
||||
createGraticule();
|
||||
const extent = [
|
||||
-25614353.926475704,
|
||||
-7827151.696402049,
|
||||
25614353.926475704,
|
||||
-25614353.926475704, -7827151.696402049, 25614353.926475704,
|
||||
7827151.696402049,
|
||||
];
|
||||
const projection = getProjection('EPSG:3857');
|
||||
@@ -45,9 +43,7 @@ describe('ol.layer.Graticule', function () {
|
||||
layers: [graticule],
|
||||
});
|
||||
const extent = [
|
||||
-25614353.926475704,
|
||||
-7827151.696402049,
|
||||
25614353.926475704,
|
||||
-25614353.926475704, -7827151.696402049, 25614353.926475704,
|
||||
7827151.696402049,
|
||||
];
|
||||
const projection = getProjection('EPSG:3857');
|
||||
@@ -97,9 +93,7 @@ describe('ol.layer.Graticule', function () {
|
||||
layers: [graticule],
|
||||
});
|
||||
const extent = [
|
||||
-25614353.926475704,
|
||||
-7827151.696402049,
|
||||
25614353.926475704,
|
||||
-25614353.926475704, -7827151.696402049, 25614353.926475704,
|
||||
7827151.696402049,
|
||||
];
|
||||
const projection = getProjection('EPSG:3857');
|
||||
@@ -183,9 +177,7 @@ describe('ol.layer.Graticule', function () {
|
||||
latLabelStyle: latLabelStyle,
|
||||
});
|
||||
const extent = [
|
||||
-25614353.926475704,
|
||||
-7827151.696402049,
|
||||
25614353.926475704,
|
||||
-25614353.926475704, -7827151.696402049, 25614353.926475704,
|
||||
7827151.696402049,
|
||||
];
|
||||
const projection = getProjection('EPSG:3857');
|
||||
@@ -224,9 +216,7 @@ describe('ol.layer.Graticule', function () {
|
||||
layers: [graticule],
|
||||
});
|
||||
const extent = [
|
||||
-25614353.926475704,
|
||||
-7827151.696402049,
|
||||
25614353.926475704,
|
||||
-25614353.926475704, -7827151.696402049, 25614353.926475704,
|
||||
7827151.696402049,
|
||||
];
|
||||
const projection = getProjection('EPSG:3857');
|
||||
|
||||
@@ -330,8 +330,7 @@ describe('ol.layer.Layer', function () {
|
||||
inView: true,
|
||||
},
|
||||
{
|
||||
when:
|
||||
'view resolution is greater than minResolution (with maxResolution)',
|
||||
when: 'view resolution is greater than minResolution (with maxResolution)',
|
||||
minResolution: 2,
|
||||
maxResolution: 4,
|
||||
view: {
|
||||
@@ -369,8 +368,7 @@ describe('ol.layer.Layer', function () {
|
||||
inView: false,
|
||||
},
|
||||
{
|
||||
when:
|
||||
'view resolution is greater than maxResolution (with minResolution)',
|
||||
when: 'view resolution is greater than maxResolution (with minResolution)',
|
||||
minResolution: 2,
|
||||
maxResolution: 4,
|
||||
view: {
|
||||
|
||||
@@ -1018,9 +1018,8 @@ describe('ol.Map', function () {
|
||||
|
||||
it('gets coordinates in view projection', function (done) {
|
||||
map.renderSync();
|
||||
const coordinateMercator = map.getCoordinateFromPixelInternal(
|
||||
screenCenter
|
||||
);
|
||||
const coordinateMercator =
|
||||
map.getCoordinateFromPixelInternal(screenCenter);
|
||||
expect(coordinateMercator[0]).to.roughlyEqual(centerMercator[0], 1e-5);
|
||||
expect(coordinateMercator[1]).to.roughlyEqual(centerMercator[1], 1e-5);
|
||||
done();
|
||||
|
||||
@@ -39,9 +39,7 @@ describe('hitdetect', function () {
|
||||
0
|
||||
);
|
||||
expect(Array.prototype.slice.call(imageData.data, 0, 3)).to.eql([
|
||||
255,
|
||||
255,
|
||||
252,
|
||||
255, 255, 252,
|
||||
]);
|
||||
});
|
||||
it('detects hit at the correct position', function () {
|
||||
|
||||
@@ -271,18 +271,12 @@ describe('ol.render.canvas.Immediate', function () {
|
||||
};
|
||||
|
||||
const transform = [
|
||||
0.0004088332670837288,
|
||||
0,
|
||||
0,
|
||||
-0.0004088332670837288,
|
||||
4480.991370439071,
|
||||
0.0004088332670837288, 0, 0, -0.0004088332670837288, 4480.991370439071,
|
||||
1529.5752568707105,
|
||||
];
|
||||
|
||||
const extent = [
|
||||
-10960437.252092224,
|
||||
2762924.0275091752,
|
||||
-7572748.158493212,
|
||||
-10960437.252092224, 2762924.0275091752, -7572748.158493212,
|
||||
3741317.9895594316,
|
||||
];
|
||||
|
||||
|
||||
@@ -121,28 +121,7 @@ describe('ol.render.canvas.TextBuilder', function () {
|
||||
builder.drawText(feature.getGeometry(), feature);
|
||||
});
|
||||
expect(builder.coordinates).to.eql([
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
6,
|
||||
7,
|
||||
7,
|
||||
8,
|
||||
8,
|
||||
9,
|
||||
9,
|
||||
10,
|
||||
10,
|
||||
0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10,
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -219,28 +198,7 @@ describe('ol.render.canvas.TextBuilder', function () {
|
||||
builder.drawText(feature.getGeometry(), feature);
|
||||
});
|
||||
expect(builder.coordinates).to.eql([
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
6,
|
||||
6,
|
||||
7,
|
||||
7,
|
||||
8,
|
||||
8,
|
||||
9,
|
||||
9,
|
||||
10,
|
||||
10,
|
||||
0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10,
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
@@ -353,14 +353,7 @@ describe('ol.render.canvas.Builder', function () {
|
||||
const flat = [-110, 45, 110, 45, 110, -45, -110, -45, -110, 45];
|
||||
replay.appendFlatLineCoordinates(flat, 0, flat.length, 2, true, true);
|
||||
expect(replay.coordinates).to.eql([
|
||||
110,
|
||||
45,
|
||||
110,
|
||||
-45,
|
||||
-110,
|
||||
-45,
|
||||
-110,
|
||||
45,
|
||||
110, 45, 110, -45, -110, -45, -110, 45,
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
@@ -385,9 +385,7 @@ describe('ol.renderer.canvas.VectorTileLayer', function () {
|
||||
target.style.height = '100px';
|
||||
document.body.appendChild(target);
|
||||
const extent = [
|
||||
1824704.739223726,
|
||||
6141868.096770482,
|
||||
1827150.7241288517,
|
||||
1824704.739223726, 6141868.096770482, 1827150.7241288517,
|
||||
6144314.081675608,
|
||||
];
|
||||
const source = new VectorTileSource({
|
||||
|
||||
@@ -593,8 +593,7 @@ describe('ol.renderer.webgl.PointsLayer', function () {
|
||||
|
||||
expect(getCache(features[0], renderer).feature).to.be(features[0]);
|
||||
expect(getCache(features[0], renderer).geometry.getCoordinates()).to.eql([
|
||||
10,
|
||||
20,
|
||||
10, 20,
|
||||
]);
|
||||
expect(getCache(features[0], renderer).properties['test']).to.be(
|
||||
features[0].get('test')
|
||||
@@ -649,10 +648,7 @@ describe('ol.renderer.webgl.PointsLayer', function () {
|
||||
zoom: 7,
|
||||
},
|
||||
extent: [
|
||||
11.1932373046875,
|
||||
46.429931640625,
|
||||
18.8067626953125,
|
||||
57.570068359375,
|
||||
11.1932373046875, 46.429931640625, 18.8067626953125, 57.570068359375,
|
||||
],
|
||||
size: [693, 1014],
|
||||
layerIndex: 0,
|
||||
|
||||
@@ -5,9 +5,7 @@ describe('ol.source.ImageStatic', function () {
|
||||
let extent, pixelRatio, projection, resolution;
|
||||
beforeEach(function () {
|
||||
extent = [
|
||||
-13637278.73946974,
|
||||
4543799.13271362,
|
||||
-13617443.330629736,
|
||||
-13637278.73946974, 4543799.13271362, -13617443.330629736,
|
||||
4553927.038961405,
|
||||
];
|
||||
pixelRatio = 1;
|
||||
@@ -20,9 +18,7 @@ describe('ol.source.ImageStatic', function () {
|
||||
const source = new Static({
|
||||
url: 'spec/ol/source/images/12-655-1583.png',
|
||||
imageExtent: [
|
||||
-13629027.891360067,
|
||||
4539747.983913189,
|
||||
-13619243.951739565,
|
||||
-13629027.891360067, 4539747.983913189, -13619243.951739565,
|
||||
4559315.863154193,
|
||||
],
|
||||
projection: projection,
|
||||
@@ -43,9 +39,7 @@ describe('ol.source.ImageStatic', function () {
|
||||
const source = new Static({
|
||||
url: 'spec/ol/source/images/12-655-1583.png',
|
||||
imageExtent: [
|
||||
-13629027.891360067,
|
||||
4539747.983913189,
|
||||
-13609460.012119063,
|
||||
-13629027.891360067, 4539747.983913189, -13609460.012119063,
|
||||
4549531.923533691,
|
||||
],
|
||||
projection: projection,
|
||||
@@ -66,9 +60,7 @@ describe('ol.source.ImageStatic', function () {
|
||||
const source = new Static({
|
||||
url: 'spec/ol/source/images/12-655-1583.png',
|
||||
imageExtent: [
|
||||
-13629027.891360067,
|
||||
4539747.983913189,
|
||||
-13619243.951739565,
|
||||
-13629027.891360067, 4539747.983913189, -13619243.951739565,
|
||||
4559315.863154193,
|
||||
],
|
||||
imageSize: [254, 254],
|
||||
@@ -90,9 +82,7 @@ describe('ol.source.ImageStatic', function () {
|
||||
const source = new Static({
|
||||
url: 'spec/ol/source/images/12-655-1583.png',
|
||||
imageExtent: [
|
||||
-13629027.891360067,
|
||||
4539747.983913189,
|
||||
-13619243.951739565,
|
||||
-13629027.891360067, 4539747.983913189, -13619243.951739565,
|
||||
4549531.923533691,
|
||||
],
|
||||
projection: projection,
|
||||
|
||||
@@ -79,9 +79,7 @@ describe('ol.source.TileJSON', function () {
|
||||
|
||||
it('returns attributions, but not when outside bounds', function () {
|
||||
tileJSON.bounds = [
|
||||
-10.764179999935878,
|
||||
49.528423000201656,
|
||||
1.9134115551745678,
|
||||
-10.764179999935878, 49.528423000201656, 1.9134115551745678,
|
||||
61.3311509999582,
|
||||
];
|
||||
const source = new TileJSON({
|
||||
|
||||
@@ -70,9 +70,7 @@ describe('ol.source.TileWMS', function () {
|
||||
const queryData = uri.searchParams;
|
||||
const bbox = queryData.get('BBOX').split(',');
|
||||
const expected = [
|
||||
-10331840.239250705,
|
||||
-15341217.324948018,
|
||||
-4696291.017841229,
|
||||
-10331840.239250705, -15341217.324948018, -4696291.017841229,
|
||||
-9705668.103538541,
|
||||
];
|
||||
for (let i = 0, ii = bbox.length; i < ii; ++i) {
|
||||
|
||||
@@ -247,9 +247,7 @@ describe('ol.source.VectorTile', function () {
|
||||
}
|
||||
|
||||
const extent = [
|
||||
665584.2026596286,
|
||||
7033250.839875697,
|
||||
667162.0221431496,
|
||||
665584.2026596286, 7033250.839875697, 667162.0221431496,
|
||||
7035280.378636755,
|
||||
];
|
||||
|
||||
@@ -257,20 +255,7 @@ describe('ol.source.VectorTile', function () {
|
||||
tileGrid: new TileGrid({
|
||||
origin: [218128, 6126002],
|
||||
resolutions: [
|
||||
4096,
|
||||
2048,
|
||||
1024,
|
||||
512,
|
||||
256,
|
||||
128,
|
||||
64,
|
||||
32,
|
||||
16,
|
||||
8,
|
||||
4,
|
||||
2,
|
||||
1,
|
||||
0.5,
|
||||
4096, 2048, 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1, 0.5,
|
||||
],
|
||||
}),
|
||||
tileUrlFunction: tileUrlFunction,
|
||||
@@ -391,9 +376,7 @@ describe('ol.source.VectorTile', function () {
|
||||
target.style.height = '100px';
|
||||
document.body.appendChild(target);
|
||||
const extent = [
|
||||
1824704.739223726,
|
||||
6141868.096770482,
|
||||
1827150.7241288517,
|
||||
1824704.739223726, 6141868.096770482, 1827150.7241288517,
|
||||
6144314.081675608,
|
||||
];
|
||||
source = new VectorTileSource({
|
||||
|
||||
@@ -47,35 +47,22 @@ describe('ol.tilegrid.WMTS', function () {
|
||||
expect(tileGrid.resolutions_).to.be.an('array');
|
||||
expect(tileGrid.resolutions_).to.have.length(20);
|
||||
expect(tileGrid.resolutions_).to.eql([
|
||||
156543.03392811998,
|
||||
78271.51696419998,
|
||||
39135.758481959994,
|
||||
19567.879241008,
|
||||
9783.939620504,
|
||||
4891.969810252,
|
||||
2445.984905126,
|
||||
1222.9924525644,
|
||||
611.4962262807999,
|
||||
305.74811314039994,
|
||||
152.87405657047998,
|
||||
76.43702828523999,
|
||||
38.21851414248,
|
||||
19.109257071295996,
|
||||
9.554628535647998,
|
||||
4.777314267823999,
|
||||
2.3886571339119995,
|
||||
1.1943285669559998,
|
||||
0.5971642834779999,
|
||||
156543.03392811998, 78271.51696419998, 39135.758481959994,
|
||||
19567.879241008, 9783.939620504, 4891.969810252, 2445.984905126,
|
||||
1222.9924525644, 611.4962262807999, 305.74811314039994,
|
||||
152.87405657047998, 76.43702828523999, 38.21851414248,
|
||||
19.109257071295996, 9.554628535647998, 4.777314267823999,
|
||||
2.3886571339119995, 1.1943285669559998, 0.5971642834779999,
|
||||
0.29858214174039993,
|
||||
]);
|
||||
|
||||
expect(tileGrid.origins_).to.be.an('array');
|
||||
expect(tileGrid.origins_).to.have.length(20);
|
||||
expect(tileGrid.origins_).to.eql(
|
||||
Array.apply(null, Array(20)).map(Array.prototype.valueOf, [
|
||||
-20037508.3428,
|
||||
20037508.3428,
|
||||
])
|
||||
Array.apply(null, Array(20)).map(
|
||||
Array.prototype.valueOf,
|
||||
[-20037508.3428, 20037508.3428]
|
||||
)
|
||||
);
|
||||
|
||||
expect(tileGrid.tileSizes_).to.be.an('array');
|
||||
@@ -133,37 +120,22 @@ describe('ol.tilegrid.WMTS', function () {
|
||||
expect(tileGrid.resolutions_).to.be.an('array');
|
||||
expect(tileGrid.resolutions_).to.have.length(22);
|
||||
expect(tileGrid.resolutions_).to.eql([
|
||||
156543.033928041,
|
||||
78271.51696402048,
|
||||
39135.758482010235,
|
||||
19567.87924100512,
|
||||
9783.93962050256,
|
||||
4891.96981025128,
|
||||
2445.98490512564,
|
||||
1222.99245256282,
|
||||
611.49622628141,
|
||||
305.7481131407048,
|
||||
152.8740565703525,
|
||||
76.43702828517624,
|
||||
38.21851414258813,
|
||||
19.10925707129406,
|
||||
9.554628535647032,
|
||||
4.777314267823516,
|
||||
2.388657133911758,
|
||||
1.194328566955879,
|
||||
0.5971642834779395,
|
||||
0.2985821417389697,
|
||||
0.1492910708694849,
|
||||
0.0746455354347424,
|
||||
156543.033928041, 78271.51696402048, 39135.758482010235,
|
||||
19567.87924100512, 9783.93962050256, 4891.96981025128, 2445.98490512564,
|
||||
1222.99245256282, 611.49622628141, 305.7481131407048, 152.8740565703525,
|
||||
76.43702828517624, 38.21851414258813, 19.10925707129406,
|
||||
9.554628535647032, 4.777314267823516, 2.388657133911758,
|
||||
1.194328566955879, 0.5971642834779395, 0.2985821417389697,
|
||||
0.1492910708694849, 0.0746455354347424,
|
||||
]);
|
||||
|
||||
expect(tileGrid.origins_).to.be.an('array');
|
||||
expect(tileGrid.origins_).to.have.length(22);
|
||||
expect(tileGrid.origins_).to.eql(
|
||||
Array.apply(null, Array(22)).map(Array.prototype.valueOf, [
|
||||
-20037508,
|
||||
20037508,
|
||||
])
|
||||
Array.apply(null, Array(22)).map(
|
||||
Array.prototype.valueOf,
|
||||
[-20037508, 20037508]
|
||||
)
|
||||
);
|
||||
|
||||
expect(tileGrid.tileSizes_).to.be.an('array');
|
||||
@@ -210,35 +182,21 @@ describe('ol.tilegrid.WMTS', function () {
|
||||
expect(tileGrid.resolutions_).to.be.an('array');
|
||||
expect(tileGrid.resolutions_).to.have.length(20);
|
||||
expect(tileGrid.resolutions_).to.eql([
|
||||
156543.033928041,
|
||||
78271.51696402048,
|
||||
39135.758482010235,
|
||||
19567.87924100512,
|
||||
9783.93962050256,
|
||||
4891.96981025128,
|
||||
2445.98490512564,
|
||||
1222.99245256282,
|
||||
611.49622628141,
|
||||
305.7481131407048,
|
||||
152.8740565703525,
|
||||
76.43702828517624,
|
||||
38.21851414258813,
|
||||
19.10925707129406,
|
||||
9.554628535647032,
|
||||
4.777314267823516,
|
||||
2.388657133911758,
|
||||
1.194328566955879,
|
||||
0.5971642834779395,
|
||||
0.2985821417389697,
|
||||
156543.033928041, 78271.51696402048, 39135.758482010235,
|
||||
19567.87924100512, 9783.93962050256, 4891.96981025128, 2445.98490512564,
|
||||
1222.99245256282, 611.49622628141, 305.7481131407048, 152.8740565703525,
|
||||
76.43702828517624, 38.21851414258813, 19.10925707129406,
|
||||
9.554628535647032, 4.777314267823516, 2.388657133911758,
|
||||
1.194328566955879, 0.5971642834779395, 0.2985821417389697,
|
||||
]);
|
||||
|
||||
expect(tileGrid.origins_).to.be.an('array');
|
||||
expect(tileGrid.origins_).to.have.length(20);
|
||||
expect(tileGrid.origins_).to.eql(
|
||||
Array.apply(null, Array(20)).map(Array.prototype.valueOf, [
|
||||
-20037508,
|
||||
20037508,
|
||||
])
|
||||
Array.apply(null, Array(20)).map(
|
||||
Array.prototype.valueOf,
|
||||
[-20037508, 20037508]
|
||||
)
|
||||
);
|
||||
|
||||
expect(tileGrid.tileSizes_).to.be.an('array');
|
||||
@@ -264,17 +222,16 @@ describe('ol.tilegrid.WMTS', function () {
|
||||
expect(tileGrid.resolutions_).to.be.an('array');
|
||||
expect(tileGrid.resolutions_).to.have.length(2);
|
||||
expect(tileGrid.resolutions_).to.eql([
|
||||
156543.033928041,
|
||||
78271.51696402048,
|
||||
156543.033928041, 78271.51696402048,
|
||||
]);
|
||||
|
||||
expect(tileGrid.origins_).to.be.an('array');
|
||||
expect(tileGrid.origins_).to.have.length(2);
|
||||
expect(tileGrid.origins_).to.eql(
|
||||
Array.apply(null, Array(2)).map(Array.prototype.valueOf, [
|
||||
-20037508,
|
||||
20037508,
|
||||
])
|
||||
Array.apply(null, Array(2)).map(
|
||||
Array.prototype.valueOf,
|
||||
[-20037508, 20037508]
|
||||
)
|
||||
);
|
||||
|
||||
expect(tileGrid.tileSizes_).to.be.an('array');
|
||||
|
||||
@@ -15,8 +15,7 @@ describe('ol.VectorTile', function () {
|
||||
const loader = tile.loader_;
|
||||
listen(tile, 'change', function (e) {
|
||||
expect(tile.getFeatures()[0].getGeometry().getFlatCoordinates()).to.eql([
|
||||
-9724792.346778862,
|
||||
4164041.638405114,
|
||||
-9724792.346778862, 4164041.638405114,
|
||||
]);
|
||||
done();
|
||||
});
|
||||
|
||||
@@ -126,22 +126,8 @@ describe('ol/array.js', function () {
|
||||
|
||||
describe('default comparison on array of Number(s)', function () {
|
||||
const d = [
|
||||
-897123.9,
|
||||
-321434.58758,
|
||||
-1321.3124,
|
||||
-324,
|
||||
-9,
|
||||
-3,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0.31255,
|
||||
5,
|
||||
142.88888708,
|
||||
334,
|
||||
342,
|
||||
453,
|
||||
54254,
|
||||
-897123.9, -321434.58758, -1321.3124, -324, -9, -3, 0, 0, 0, 0.31255, 5,
|
||||
142.88888708, 334, 342, 453, 54254,
|
||||
];
|
||||
it('should find -897123.9 at index 0', function () {
|
||||
expect(binarySearch(d, -897123.9)).to.be(0);
|
||||
@@ -187,22 +173,8 @@ describe('ol/array.js', function () {
|
||||
|
||||
describe('custom comparison function, which reverse orders numbers', function () {
|
||||
const e = [
|
||||
54254,
|
||||
453,
|
||||
342,
|
||||
334,
|
||||
142.88888708,
|
||||
5,
|
||||
0.31255,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
-3,
|
||||
-9,
|
||||
-324,
|
||||
-1321.3124,
|
||||
-321434.58758,
|
||||
-897123.9,
|
||||
54254, 453, 342, 334, 142.88888708, 5, 0.31255, 0, 0, 0, -3, -9, -324,
|
||||
-1321.3124, -321434.58758, -897123.9,
|
||||
];
|
||||
it('should find 54254 at index 0', function () {
|
||||
const pos = binarySearch(e, 54254, revNumCompare);
|
||||
|
||||
@@ -519,10 +519,12 @@ describe('ol/extent.js', function () {
|
||||
});
|
||||
|
||||
it('works for rotation', function () {
|
||||
const extent = _ol_extent_.getForViewAndSize([0, 0], 1, Math.PI / 4, [
|
||||
const extent = _ol_extent_.getForViewAndSize(
|
||||
[0, 0],
|
||||
1,
|
||||
1,
|
||||
]);
|
||||
Math.PI / 4,
|
||||
[1, 1]
|
||||
);
|
||||
expect(extent[0]).to.roughlyEqual(-Math.sqrt(0.5), 1e-9);
|
||||
expect(extent[2]).to.roughlyEqual(Math.sqrt(0.5), 1e-9);
|
||||
expect(extent[1]).to.roughlyEqual(-Math.sqrt(0.5), 1e-9);
|
||||
@@ -889,85 +891,55 @@ describe('ol/extent.js', function () {
|
||||
|
||||
it('leaves real world extent untouched', function () {
|
||||
expect(_ol_extent_.wrapX([16, 48, 18, 49], projection)).to.eql([
|
||||
16,
|
||||
48,
|
||||
18,
|
||||
49,
|
||||
16, 48, 18, 49,
|
||||
]);
|
||||
});
|
||||
|
||||
it('moves left world extent to real world', function () {
|
||||
expect(_ol_extent_.wrapX([-344, 48, -342, 49], projection)).to.eql([
|
||||
16,
|
||||
48,
|
||||
18,
|
||||
49,
|
||||
16, 48, 18, 49,
|
||||
]);
|
||||
});
|
||||
|
||||
it('moves right world extent to real world', function () {
|
||||
expect(_ol_extent_.wrapX([376, 48, 378, 49], projection)).to.eql([
|
||||
16,
|
||||
48,
|
||||
18,
|
||||
49,
|
||||
16, 48, 18, 49,
|
||||
]);
|
||||
});
|
||||
|
||||
it('moves far off left extent to real world', function () {
|
||||
expect(_ol_extent_.wrapX([-1064, 48, -1062, 49], projection)).to.eql([
|
||||
16,
|
||||
48,
|
||||
18,
|
||||
49,
|
||||
16, 48, 18, 49,
|
||||
]);
|
||||
});
|
||||
|
||||
it('moves far off right extent to real world', function () {
|
||||
expect(_ol_extent_.wrapX([1096, 48, 1098, 49], projection)).to.eql([
|
||||
16,
|
||||
48,
|
||||
18,
|
||||
49,
|
||||
16, 48, 18, 49,
|
||||
]);
|
||||
});
|
||||
|
||||
it('leaves -180 crossing extent with real world center untouched', function () {
|
||||
expect(_ol_extent_.wrapX([-184, 48, 16, 49], projection)).to.eql([
|
||||
-184,
|
||||
48,
|
||||
16,
|
||||
49,
|
||||
-184, 48, 16, 49,
|
||||
]);
|
||||
});
|
||||
|
||||
it('moves +180 crossing extent with off-world center to the real world', function () {
|
||||
expect(_ol_extent_.wrapX([300, 48, 376, 49], projection)).to.eql([
|
||||
-60,
|
||||
48,
|
||||
16,
|
||||
49,
|
||||
-60, 48, 16, 49,
|
||||
]);
|
||||
});
|
||||
|
||||
it('produces the same real world extent for shifted extents with center at +/-180', function () {
|
||||
expect(_ol_extent_.wrapX([360, -90, 720, 90], projection)).to.eql([
|
||||
-360,
|
||||
-90,
|
||||
0,
|
||||
90,
|
||||
-360, -90, 0, 90,
|
||||
]);
|
||||
expect(_ol_extent_.wrapX([0, -90, 360, 90], projection)).to.eql([
|
||||
-360,
|
||||
-90,
|
||||
0,
|
||||
90,
|
||||
-360, -90, 0, 90,
|
||||
]);
|
||||
expect(_ol_extent_.wrapX([-360, -90, 0, 90], projection)).to.eql([
|
||||
-360,
|
||||
-90,
|
||||
0,
|
||||
90,
|
||||
-360, -90, 0, 90,
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -391,12 +391,13 @@ describe('ol/format/EsriJSON.js', function () {
|
||||
const firstGeom = first.getGeometry();
|
||||
expect(firstGeom).to.be.a(Polygon);
|
||||
expect(
|
||||
equals(firstGeom.getExtent(), [
|
||||
-10585772.743554419,
|
||||
4712365.161160459,
|
||||
-10579560.16462974,
|
||||
4716567.373073828,
|
||||
])
|
||||
equals(
|
||||
firstGeom.getExtent(),
|
||||
[
|
||||
-10585772.743554419, 4712365.161160459, -10579560.16462974,
|
||||
4716567.373073828,
|
||||
]
|
||||
)
|
||||
).to.be(true);
|
||||
|
||||
const last = result[8];
|
||||
@@ -406,12 +407,13 @@ describe('ol/format/EsriJSON.js', function () {
|
||||
const lastGeom = last.getGeometry();
|
||||
expect(lastGeom).to.be.a(Polygon);
|
||||
expect(
|
||||
equals(lastGeom.getExtent(), [
|
||||
-10555714.026858449,
|
||||
4576511.565880965,
|
||||
-10553671.199322715,
|
||||
4578554.9934867555,
|
||||
])
|
||||
equals(
|
||||
lastGeom.getExtent(),
|
||||
[
|
||||
-10555714.026858449, 4576511.565880965, -10553671.199322715,
|
||||
4578554.9934867555,
|
||||
]
|
||||
)
|
||||
).to.be(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -358,12 +358,10 @@ describe('ol/format/GeoJSON.js', function () {
|
||||
const firstGeom = first.getGeometry();
|
||||
expect(firstGeom).to.be.a(Polygon);
|
||||
expect(
|
||||
equals(firstGeom.getExtent(), [
|
||||
60.52843,
|
||||
29.318572,
|
||||
75.158028,
|
||||
38.486282,
|
||||
])
|
||||
equals(
|
||||
firstGeom.getExtent(),
|
||||
[60.52843, 29.318572, 75.158028, 38.486282]
|
||||
)
|
||||
).to.be(true);
|
||||
|
||||
const last = result[178];
|
||||
@@ -373,12 +371,10 @@ describe('ol/format/GeoJSON.js', function () {
|
||||
const lastGeom = last.getGeometry();
|
||||
expect(lastGeom).to.be.a(Polygon);
|
||||
expect(
|
||||
equals(lastGeom.getExtent(), [
|
||||
25.264226,
|
||||
-22.271612,
|
||||
32.849861,
|
||||
-15.507787,
|
||||
])
|
||||
equals(
|
||||
lastGeom.getExtent(),
|
||||
[25.264226, -22.271612, 32.849861, -15.507787]
|
||||
)
|
||||
).to.be(true);
|
||||
});
|
||||
|
||||
|
||||
@@ -93,9 +93,7 @@ describe('ol/format/TopoJSON.js', function () {
|
||||
expect(feature.get('prop0')).to.be('value0');
|
||||
|
||||
expect(geometry.getExtent()).to.eql([
|
||||
-70.08100810081008,
|
||||
12.417091709170947,
|
||||
-69.9009900990099,
|
||||
-70.08100810081008, 12.417091709170947, -69.9009900990099,
|
||||
12.608069195591469,
|
||||
]);
|
||||
});
|
||||
@@ -138,29 +136,13 @@ describe('ol/format/TopoJSON.js', function () {
|
||||
const line = features[1].getGeometry();
|
||||
expect(line.getType()).to.be('LineString');
|
||||
expect(line.getFlatCoordinates()).to.eql([
|
||||
102,
|
||||
0,
|
||||
103,
|
||||
1,
|
||||
104,
|
||||
0,
|
||||
105,
|
||||
1,
|
||||
102, 0, 103, 1, 104, 0, 105, 1,
|
||||
]);
|
||||
|
||||
const polygon = features[2].getGeometry();
|
||||
expect(polygon.getType()).to.be('Polygon');
|
||||
expect(polygon.getFlatCoordinates()).to.eql([
|
||||
100,
|
||||
0,
|
||||
100,
|
||||
1,
|
||||
101,
|
||||
1,
|
||||
101,
|
||||
0,
|
||||
100,
|
||||
0,
|
||||
100, 0, 100, 1, 101, 1, 101, 0, 100, 0,
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -216,10 +198,7 @@ describe('ol/format/TopoJSON.js', function () {
|
||||
const firstGeom = first.getGeometry();
|
||||
expect(firstGeom).to.be.a(MultiPolygon);
|
||||
expect(firstGeom.getExtent()).to.eql([
|
||||
-180,
|
||||
-85.60903777459777,
|
||||
180,
|
||||
83.64513000000002,
|
||||
-180, -85.60903777459777, 180, 83.64513000000002,
|
||||
]);
|
||||
|
||||
const last = features[177];
|
||||
@@ -227,9 +206,7 @@ describe('ol/format/TopoJSON.js', function () {
|
||||
const lastGeom = last.getGeometry();
|
||||
expect(lastGeom).to.be.a(Polygon);
|
||||
expect(lastGeom.getExtent()).to.eql([
|
||||
25.26325263252633,
|
||||
-22.271802279310577,
|
||||
32.848528485284874,
|
||||
25.26325263252633, -22.271802279310577, 32.848528485284874,
|
||||
-15.50833810039586,
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -979,27 +979,8 @@ describe('ol/format/WKB.js', function () {
|
||||
it('returns the default projection', function () {
|
||||
const wkb = new Uint8Array([
|
||||
// POINT(1 2)
|
||||
0x01,
|
||||
0x01,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0xf0,
|
||||
0x3f,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x40,
|
||||
0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
|
||||
0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
|
||||
]);
|
||||
const projection = format.readProjection(wkb);
|
||||
expect(projection).to.be(undefined);
|
||||
@@ -1008,30 +989,8 @@ describe('ol/format/WKB.js', function () {
|
||||
it('returns an embed projection', function () {
|
||||
const wkb = new Uint8Array([
|
||||
// SRID=4326;POINT(1 2)
|
||||
0x01,
|
||||
0x01,
|
||||
0x00,
|
||||
0x00,
|
||||
0x20,
|
||||
0xe6,
|
||||
0x10,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0xf0,
|
||||
0x3f,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x01, 0x01, 0x00, 0x00, 0x20, 0xe6, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x40,
|
||||
]);
|
||||
const projection = format.readProjection(wkb);
|
||||
@@ -1066,27 +1025,8 @@ describe('ol/format/WKB.js', function () {
|
||||
it('transforms with dataProjection and featureProjection', function () {
|
||||
const wkb = new Uint8Array([
|
||||
// POINT(1 2)
|
||||
0x01,
|
||||
0x01,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0xf0,
|
||||
0x3f,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x40,
|
||||
0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0,
|
||||
0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
|
||||
]);
|
||||
const geom = format.readGeometry(wkb, {
|
||||
dataProjection: 'EPSG:4326',
|
||||
@@ -1100,30 +1040,8 @@ describe('ol/format/WKB.js', function () {
|
||||
it('transforms with auto detection of dataProjection', function () {
|
||||
const wkb = new Uint8Array([
|
||||
// SRID=4326;POINT(1 2)
|
||||
0x01,
|
||||
0x01,
|
||||
0x00,
|
||||
0x00,
|
||||
0x20,
|
||||
0xe6,
|
||||
0x10,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0xf0,
|
||||
0x3f,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x01, 0x01, 0x00, 0x00, 0x20, 0xe6, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x40,
|
||||
]);
|
||||
const geom = format.readGeometry(wkb, {
|
||||
|
||||
@@ -106,14 +106,7 @@ describe('ol/geom/MultiLineString.js', function () {
|
||||
|
||||
it('has the expected flat coordinates', function () {
|
||||
expect(multiLineString.getFlatCoordinates()).to.eql([
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
1, 2, 3, 4, 5, 6, 7, 8,
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -176,18 +169,7 @@ describe('ol/geom/MultiLineString.js', function () {
|
||||
|
||||
it('has the expected flat coordinates', function () {
|
||||
expect(multiLineString.getFlatCoordinates()).to.eql([
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -237,18 +219,7 @@ describe('ol/geom/MultiLineString.js', function () {
|
||||
|
||||
it('has the expected flat coordinates', function () {
|
||||
expect(multiLineString.getFlatCoordinates()).to.eql([
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -277,49 +248,31 @@ describe('ol/geom/MultiLineString.js', function () {
|
||||
describe('with extrapolation and interpolation', function () {
|
||||
it('returns the expected value', function () {
|
||||
expect(multiLineString.getCoordinateAtM(0, true, true)).to.eql([
|
||||
1,
|
||||
2,
|
||||
0,
|
||||
1, 2, 0,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(3, true, true)).to.eql([
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
1, 2, 3,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(4.5, true, true)).to.eql([
|
||||
2.5,
|
||||
3.5,
|
||||
4.5,
|
||||
2.5, 3.5, 4.5,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(6, true, true)).to.eql([
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
4, 5, 6,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(7.5, true, true)).to.eql([
|
||||
5.5,
|
||||
6.5,
|
||||
7.5,
|
||||
5.5, 6.5, 7.5,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(9, true, true)).to.eql([
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
7, 8, 9,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(10.5, true, true)).to.eql([
|
||||
8.5,
|
||||
9.5,
|
||||
10.5,
|
||||
8.5, 9.5, 10.5,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(12, true, true)).to.eql([
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
10, 11, 12,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(15, true, true)).to.eql([
|
||||
10,
|
||||
11,
|
||||
15,
|
||||
10, 11, 15,
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -327,47 +280,31 @@ describe('ol/geom/MultiLineString.js', function () {
|
||||
describe('with extrapolation and no interpolation', function () {
|
||||
it('returns the expected value', function () {
|
||||
expect(multiLineString.getCoordinateAtM(0, true, false)).to.eql([
|
||||
1,
|
||||
2,
|
||||
0,
|
||||
1, 2, 0,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(3, true, false)).to.eql([
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
1, 2, 3,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(4.5, true, false)).to.eql([
|
||||
2.5,
|
||||
3.5,
|
||||
4.5,
|
||||
2.5, 3.5, 4.5,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(6, true, false)).to.eql([
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
4, 5, 6,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(7.5, true, false)).to.be(
|
||||
null
|
||||
);
|
||||
expect(multiLineString.getCoordinateAtM(9, true, false)).to.eql([
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
7, 8, 9,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(10.5, true, false)).to.eql([
|
||||
8.5,
|
||||
9.5,
|
||||
10.5,
|
||||
8.5, 9.5, 10.5,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(12, true, false)).to.eql([
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
10, 11, 12,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(15, true, false)).to.eql([
|
||||
10,
|
||||
11,
|
||||
15,
|
||||
10, 11, 15,
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -376,39 +313,25 @@ describe('ol/geom/MultiLineString.js', function () {
|
||||
it('returns the expected value', function () {
|
||||
expect(multiLineString.getCoordinateAtM(0, false, true)).to.eql(null);
|
||||
expect(multiLineString.getCoordinateAtM(3, false, true)).to.eql([
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
1, 2, 3,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(4.5, false, true)).to.eql([
|
||||
2.5,
|
||||
3.5,
|
||||
4.5,
|
||||
2.5, 3.5, 4.5,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(6, false, true)).to.eql([
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
4, 5, 6,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(7.5, false, true)).to.eql([
|
||||
5.5,
|
||||
6.5,
|
||||
7.5,
|
||||
5.5, 6.5, 7.5,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(9, false, true)).to.eql([
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
7, 8, 9,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(10.5, false, true)).to.eql([
|
||||
8.5,
|
||||
9.5,
|
||||
10.5,
|
||||
8.5, 9.5, 10.5,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(12, false, true)).to.eql([
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
10, 11, 12,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(15, false, true)).to.eql(
|
||||
null
|
||||
@@ -422,37 +345,25 @@ describe('ol/geom/MultiLineString.js', function () {
|
||||
null
|
||||
);
|
||||
expect(multiLineString.getCoordinateAtM(3, false, false)).to.eql([
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
1, 2, 3,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(4.5, false, false)).to.eql([
|
||||
2.5,
|
||||
3.5,
|
||||
4.5,
|
||||
2.5, 3.5, 4.5,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(6, false, false)).to.eql([
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
4, 5, 6,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(7.5, false, false)).to.eql(
|
||||
null
|
||||
);
|
||||
expect(multiLineString.getCoordinateAtM(9, false, false)).to.eql([
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
7, 8, 9,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(10.5, false, false)).to.eql([
|
||||
8.5,
|
||||
9.5,
|
||||
10.5,
|
||||
8.5, 9.5, 10.5,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(12, false, false)).to.eql([
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
10, 11, 12,
|
||||
]);
|
||||
expect(multiLineString.getCoordinateAtM(15, false, false)).to.eql(
|
||||
null
|
||||
@@ -500,22 +411,7 @@ describe('ol/geom/MultiLineString.js', function () {
|
||||
|
||||
it('has the expected flat coordinates', function () {
|
||||
expect(multiLineString.getFlatCoordinates()).to.eql([
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -613,14 +509,7 @@ describe('ol/geom/MultiLineString.js', function () {
|
||||
]);
|
||||
const multiLineString = new MultiLineString([lineString1, lineString2]);
|
||||
expect(multiLineString.getFlatCoordinates()).to.eql([
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
1, 2, 3, 4, 5, 6, 7, 8,
|
||||
]);
|
||||
expect(multiLineString.getEnds()).to.eql([4, 8]);
|
||||
const coordinates = multiLineString.getCoordinates();
|
||||
|
||||
@@ -438,46 +438,8 @@ describe('ol/geom/Polygon.js', function () {
|
||||
];
|
||||
polygon = new Polygon([outerRing, innerRing1, innerRing2]);
|
||||
flatCoordinates = [
|
||||
0,
|
||||
6,
|
||||
1,
|
||||
2,
|
||||
6,
|
||||
6,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
0,
|
||||
5,
|
||||
6,
|
||||
2,
|
||||
4,
|
||||
7,
|
||||
8,
|
||||
4,
|
||||
4,
|
||||
9,
|
||||
10,
|
||||
4,
|
||||
5,
|
||||
11,
|
||||
12,
|
||||
2,
|
||||
5,
|
||||
13,
|
||||
14,
|
||||
3,
|
||||
2,
|
||||
15,
|
||||
16,
|
||||
4,
|
||||
3,
|
||||
17,
|
||||
18,
|
||||
2,
|
||||
3,
|
||||
19,
|
||||
20,
|
||||
0, 6, 1, 2, 6, 6, 3, 4, 3, 0, 5, 6, 2, 4, 7, 8, 4, 4, 9, 10, 4, 5, 11,
|
||||
12, 2, 5, 13, 14, 3, 2, 15, 16, 4, 3, 17, 18, 2, 3, 19, 20,
|
||||
];
|
||||
outsideOuter = [1, 1];
|
||||
inside = [3, 1];
|
||||
|
||||
@@ -89,206 +89,29 @@ describe('ol/geom/flat/closest.js', function () {
|
||||
|
||||
describe('with real data', function () {
|
||||
const flatCoordinates = [
|
||||
224.55,
|
||||
250.15,
|
||||
226.91,
|
||||
244.19,
|
||||
233.31,
|
||||
241.45,
|
||||
234.98,
|
||||
236.06,
|
||||
244.21,
|
||||
232.76,
|
||||
262.59,
|
||||
215.31,
|
||||
267.76,
|
||||
213.81,
|
||||
273.57,
|
||||
201.84,
|
||||
273.12,
|
||||
192.16,
|
||||
277.62,
|
||||
189.03,
|
||||
280.36,
|
||||
181.41,
|
||||
286.51,
|
||||
177.74,
|
||||
292.41,
|
||||
159.37,
|
||||
296.91,
|
||||
155.64,
|
||||
314.95,
|
||||
151.37,
|
||||
319.75,
|
||||
145.16,
|
||||
330.33,
|
||||
137.57,
|
||||
341.48,
|
||||
139.96,
|
||||
369.98,
|
||||
137.89,
|
||||
387.39,
|
||||
142.51,
|
||||
391.28,
|
||||
139.39,
|
||||
409.52,
|
||||
141.14,
|
||||
414.82,
|
||||
139.75,
|
||||
427.72,
|
||||
127.3,
|
||||
439.6,
|
||||
119.74,
|
||||
474.93,
|
||||
107.87,
|
||||
486.51,
|
||||
106.75,
|
||||
489.2,
|
||||
109.45,
|
||||
493.79,
|
||||
108.63,
|
||||
504.74,
|
||||
119.66,
|
||||
512.96,
|
||||
122.35,
|
||||
518.63,
|
||||
120.89,
|
||||
524.09,
|
||||
126.88,
|
||||
529.57,
|
||||
127.86,
|
||||
534.21,
|
||||
140.93,
|
||||
539.27,
|
||||
147.24,
|
||||
567.69,
|
||||
148.91,
|
||||
575.25,
|
||||
157.26,
|
||||
580.62,
|
||||
158.15,
|
||||
601.53,
|
||||
156.85,
|
||||
617.74,
|
||||
159.86,
|
||||
622.0,
|
||||
167.04,
|
||||
629.55,
|
||||
194.6,
|
||||
638.9,
|
||||
195.61,
|
||||
641.26,
|
||||
200.81,
|
||||
651.77,
|
||||
204.56,
|
||||
671.55,
|
||||
222.55,
|
||||
683.68,
|
||||
217.45,
|
||||
695.25,
|
||||
219.15,
|
||||
700.64,
|
||||
217.98,
|
||||
703.12,
|
||||
214.36,
|
||||
712.26,
|
||||
215.87,
|
||||
721.49,
|
||||
212.81,
|
||||
727.81,
|
||||
213.36,
|
||||
729.98,
|
||||
208.73,
|
||||
735.32,
|
||||
208.2,
|
||||
739.94,
|
||||
204.77,
|
||||
769.98,
|
||||
208.42,
|
||||
779.6,
|
||||
216.87,
|
||||
784.2,
|
||||
218.16,
|
||||
800.24,
|
||||
214.62,
|
||||
810.53,
|
||||
219.73,
|
||||
817.19,
|
||||
226.82,
|
||||
820.77,
|
||||
236.17,
|
||||
827.23,
|
||||
236.16,
|
||||
829.89,
|
||||
239.89,
|
||||
851.0,
|
||||
248.94,
|
||||
859.88,
|
||||
255.49,
|
||||
865.21,
|
||||
268.53,
|
||||
857.95,
|
||||
280.3,
|
||||
865.48,
|
||||
291.45,
|
||||
866.81,
|
||||
298.66,
|
||||
864.68,
|
||||
302.71,
|
||||
867.79,
|
||||
306.17,
|
||||
859.87,
|
||||
311.37,
|
||||
860.08,
|
||||
314.35,
|
||||
858.29,
|
||||
314.94,
|
||||
858.1,
|
||||
327.6,
|
||||
854.54,
|
||||
335.4,
|
||||
860.92,
|
||||
343.0,
|
||||
856.43,
|
||||
350.15,
|
||||
851.42,
|
||||
352.96,
|
||||
849.84,
|
||||
359.59,
|
||||
854.56,
|
||||
365.53,
|
||||
849.74,
|
||||
370.38,
|
||||
844.09,
|
||||
371.89,
|
||||
844.75,
|
||||
380.44,
|
||||
841.52,
|
||||
383.67,
|
||||
839.57,
|
||||
390.4,
|
||||
845.59,
|
||||
399.05,
|
||||
848.4,
|
||||
407.55,
|
||||
843.71,
|
||||
411.3,
|
||||
844.09,
|
||||
419.88,
|
||||
839.51,
|
||||
432.76,
|
||||
841.33,
|
||||
441.04,
|
||||
847.62,
|
||||
449.22,
|
||||
847.16,
|
||||
458.44,
|
||||
851.38,
|
||||
462.79,
|
||||
853.97,
|
||||
471.15,
|
||||
866.36,
|
||||
480.77,
|
||||
224.55, 250.15, 226.91, 244.19, 233.31, 241.45, 234.98, 236.06, 244.21,
|
||||
232.76, 262.59, 215.31, 267.76, 213.81, 273.57, 201.84, 273.12, 192.16,
|
||||
277.62, 189.03, 280.36, 181.41, 286.51, 177.74, 292.41, 159.37, 296.91,
|
||||
155.64, 314.95, 151.37, 319.75, 145.16, 330.33, 137.57, 341.48, 139.96,
|
||||
369.98, 137.89, 387.39, 142.51, 391.28, 139.39, 409.52, 141.14, 414.82,
|
||||
139.75, 427.72, 127.3, 439.6, 119.74, 474.93, 107.87, 486.51, 106.75,
|
||||
489.2, 109.45, 493.79, 108.63, 504.74, 119.66, 512.96, 122.35, 518.63,
|
||||
120.89, 524.09, 126.88, 529.57, 127.86, 534.21, 140.93, 539.27, 147.24,
|
||||
567.69, 148.91, 575.25, 157.26, 580.62, 158.15, 601.53, 156.85, 617.74,
|
||||
159.86, 622.0, 167.04, 629.55, 194.6, 638.9, 195.61, 641.26, 200.81,
|
||||
651.77, 204.56, 671.55, 222.55, 683.68, 217.45, 695.25, 219.15, 700.64,
|
||||
217.98, 703.12, 214.36, 712.26, 215.87, 721.49, 212.81, 727.81, 213.36,
|
||||
729.98, 208.73, 735.32, 208.2, 739.94, 204.77, 769.98, 208.42, 779.6,
|
||||
216.87, 784.2, 218.16, 800.24, 214.62, 810.53, 219.73, 817.19, 226.82,
|
||||
820.77, 236.17, 827.23, 236.16, 829.89, 239.89, 851.0, 248.94, 859.88,
|
||||
255.49, 865.21, 268.53, 857.95, 280.3, 865.48, 291.45, 866.81, 298.66,
|
||||
864.68, 302.71, 867.79, 306.17, 859.87, 311.37, 860.08, 314.35, 858.29,
|
||||
314.94, 858.1, 327.6, 854.54, 335.4, 860.92, 343.0, 856.43, 350.15,
|
||||
851.42, 352.96, 849.84, 359.59, 854.56, 365.53, 849.74, 370.38, 844.09,
|
||||
371.89, 844.75, 380.44, 841.52, 383.67, 839.57, 390.4, 845.59, 399.05,
|
||||
848.4, 407.55, 843.71, 411.3, 844.09, 419.88, 839.51, 432.76, 841.33,
|
||||
441.04, 847.62, 449.22, 847.16, 458.44, 851.38, 462.79, 853.97, 471.15,
|
||||
866.36, 480.77,
|
||||
];
|
||||
|
||||
describe('maxSquaredDelta', function () {
|
||||
|
||||
@@ -5,26 +5,7 @@ describe('ol/geom/flat/contains.js', function () {
|
||||
describe('with simple data', function () {
|
||||
const flatCoordinatesSimple = [0, 0, 1, 0, 1, 1, 0, 1];
|
||||
const flatCoordinatesNonSimple = [
|
||||
0,
|
||||
0,
|
||||
4,
|
||||
0,
|
||||
4,
|
||||
3,
|
||||
1,
|
||||
3,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
3,
|
||||
1,
|
||||
2,
|
||||
1,
|
||||
2,
|
||||
4,
|
||||
0,
|
||||
4,
|
||||
0, 0, 4, 0, 4, 3, 1, 3, 1, 2, 3, 2, 3, 1, 2, 1, 2, 4, 0, 4,
|
||||
];
|
||||
|
||||
describe('linearRingContainsXY', function () {
|
||||
|
||||
@@ -144,32 +144,8 @@ describe('ol/geom/flat/intersectsextent.js', function () {
|
||||
let ends;
|
||||
beforeEach(function () {
|
||||
flatCoordinates = [
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
10,
|
||||
10,
|
||||
10,
|
||||
10,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
/*hole*/ 2,
|
||||
2,
|
||||
8,
|
||||
2,
|
||||
8,
|
||||
4,
|
||||
5,
|
||||
5,
|
||||
8,
|
||||
6,
|
||||
8,
|
||||
8,
|
||||
2,
|
||||
8,
|
||||
2,
|
||||
2,
|
||||
0, 0, 0, 10, 10, 10, 10, 0, 0, 0, /*hole*/ 2, 2, 8, 2, 8, 4, 5, 5, 8, 6,
|
||||
8, 8, 2, 8, 2, 2,
|
||||
];
|
||||
ends = [10, flatCoordinates.length];
|
||||
});
|
||||
|
||||
@@ -91,49 +91,13 @@ describe('ol/geom/flat/orient.js', function () {
|
||||
const oriented = linearRingsAreOriented;
|
||||
|
||||
const rightCoords = [
|
||||
-180,
|
||||
-90,
|
||||
180,
|
||||
-90,
|
||||
180,
|
||||
90,
|
||||
-180,
|
||||
90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
-100,
|
||||
45,
|
||||
100,
|
||||
45,
|
||||
100,
|
||||
-45,
|
||||
-100,
|
||||
-45,
|
||||
-180, -90, 180, -90, 180, 90, -180, 90, -180, -90, -100, -45, -100, 45,
|
||||
100, 45, 100, -45, -100, -45,
|
||||
];
|
||||
|
||||
const leftCoords = [
|
||||
-180,
|
||||
-90,
|
||||
-180,
|
||||
90,
|
||||
180,
|
||||
90,
|
||||
180,
|
||||
-90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
100,
|
||||
-45,
|
||||
100,
|
||||
45,
|
||||
-100,
|
||||
45,
|
||||
-100,
|
||||
-45,
|
||||
-180, -90, -180, 90, 180, 90, 180, -90, -180, -90, -100, -45, 100, -45,
|
||||
100, 45, -100, 45, -100, -45,
|
||||
];
|
||||
|
||||
const ends = [10, 20];
|
||||
@@ -153,89 +117,15 @@ describe('ol/geom/flat/orient.js', function () {
|
||||
const oriented = linearRingssAreOriented;
|
||||
|
||||
const rightCoords = [
|
||||
-180,
|
||||
-90,
|
||||
180,
|
||||
-90,
|
||||
180,
|
||||
90,
|
||||
-180,
|
||||
90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
-100,
|
||||
45,
|
||||
100,
|
||||
45,
|
||||
100,
|
||||
-45,
|
||||
-100,
|
||||
-45,
|
||||
-180,
|
||||
-90,
|
||||
180,
|
||||
-90,
|
||||
180,
|
||||
90,
|
||||
-180,
|
||||
90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
-100,
|
||||
45,
|
||||
100,
|
||||
45,
|
||||
100,
|
||||
-45,
|
||||
-100,
|
||||
-45,
|
||||
-180, -90, 180, -90, 180, 90, -180, 90, -180, -90, -100, -45, -100, 45,
|
||||
100, 45, 100, -45, -100, -45, -180, -90, 180, -90, 180, 90, -180, 90,
|
||||
-180, -90, -100, -45, -100, 45, 100, 45, 100, -45, -100, -45,
|
||||
];
|
||||
|
||||
const leftCoords = [
|
||||
-180,
|
||||
-90,
|
||||
-180,
|
||||
90,
|
||||
180,
|
||||
90,
|
||||
180,
|
||||
-90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
100,
|
||||
-45,
|
||||
100,
|
||||
45,
|
||||
-100,
|
||||
45,
|
||||
-100,
|
||||
-45,
|
||||
-180,
|
||||
-90,
|
||||
-180,
|
||||
90,
|
||||
180,
|
||||
90,
|
||||
180,
|
||||
-90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
100,
|
||||
-45,
|
||||
100,
|
||||
45,
|
||||
-100,
|
||||
45,
|
||||
-100,
|
||||
-45,
|
||||
-180, -90, -180, 90, 180, 90, 180, -90, -180, -90, -100, -45, 100, -45,
|
||||
100, 45, -100, 45, -100, -45, -180, -90, -180, 90, 180, 90, 180, -90,
|
||||
-180, -90, -100, -45, 100, -45, 100, 45, -100, 45, -100, -45,
|
||||
];
|
||||
|
||||
const ends = [
|
||||
@@ -258,49 +148,13 @@ describe('ol/geom/flat/orient.js', function () {
|
||||
const orient = orientLinearRings;
|
||||
|
||||
const rightCoords = [
|
||||
-180,
|
||||
-90,
|
||||
180,
|
||||
-90,
|
||||
180,
|
||||
90,
|
||||
-180,
|
||||
90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
-100,
|
||||
45,
|
||||
100,
|
||||
45,
|
||||
100,
|
||||
-45,
|
||||
-100,
|
||||
-45,
|
||||
-180, -90, 180, -90, 180, 90, -180, 90, -180, -90, -100, -45, -100, 45,
|
||||
100, 45, 100, -45, -100, -45,
|
||||
];
|
||||
|
||||
const leftCoords = [
|
||||
-180,
|
||||
-90,
|
||||
-180,
|
||||
90,
|
||||
180,
|
||||
90,
|
||||
180,
|
||||
-90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
100,
|
||||
-45,
|
||||
100,
|
||||
45,
|
||||
-100,
|
||||
45,
|
||||
-100,
|
||||
-45,
|
||||
-180, -90, -180, 90, 180, 90, 180, -90, -180, -90, -100, -45, 100, -45,
|
||||
100, 45, -100, 45, -100, -45,
|
||||
];
|
||||
|
||||
const ends = [10, 20];
|
||||
@@ -330,89 +184,15 @@ describe('ol/geom/flat/orient.js', function () {
|
||||
const orient = orientLinearRingsArray;
|
||||
|
||||
const rightCoords = [
|
||||
-180,
|
||||
-90,
|
||||
180,
|
||||
-90,
|
||||
180,
|
||||
90,
|
||||
-180,
|
||||
90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
-100,
|
||||
45,
|
||||
100,
|
||||
45,
|
||||
100,
|
||||
-45,
|
||||
-100,
|
||||
-45,
|
||||
-180,
|
||||
-90,
|
||||
180,
|
||||
-90,
|
||||
180,
|
||||
90,
|
||||
-180,
|
||||
90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
-100,
|
||||
45,
|
||||
100,
|
||||
45,
|
||||
100,
|
||||
-45,
|
||||
-100,
|
||||
-45,
|
||||
-180, -90, 180, -90, 180, 90, -180, 90, -180, -90, -100, -45, -100, 45,
|
||||
100, 45, 100, -45, -100, -45, -180, -90, 180, -90, 180, 90, -180, 90,
|
||||
-180, -90, -100, -45, -100, 45, 100, 45, 100, -45, -100, -45,
|
||||
];
|
||||
|
||||
const leftCoords = [
|
||||
-180,
|
||||
-90,
|
||||
-180,
|
||||
90,
|
||||
180,
|
||||
90,
|
||||
180,
|
||||
-90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
100,
|
||||
-45,
|
||||
100,
|
||||
45,
|
||||
-100,
|
||||
45,
|
||||
-100,
|
||||
-45,
|
||||
-180,
|
||||
-90,
|
||||
-180,
|
||||
90,
|
||||
180,
|
||||
90,
|
||||
180,
|
||||
-90,
|
||||
-180,
|
||||
-90,
|
||||
-100,
|
||||
-45,
|
||||
100,
|
||||
-45,
|
||||
100,
|
||||
45,
|
||||
-100,
|
||||
45,
|
||||
-100,
|
||||
-45,
|
||||
-180, -90, -180, 90, 180, 90, 180, -90, -180, -90, -100, -45, 100, -45,
|
||||
100, 45, -100, 45, -100, -45, -180, -90, -180, 90, 180, 90, 180, -90,
|
||||
-180, -90, -100, -45, 100, -45, 100, 45, -100, 45, -100, -45,
|
||||
];
|
||||
|
||||
const ends = [
|
||||
|
||||
@@ -94,41 +94,11 @@ describe('ol/geom/flat/reverse.js', function () {
|
||||
|
||||
it('can reverse four flat coordinates', function () {
|
||||
const flatCoordinates = [
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
|
||||
];
|
||||
reverseCoordinates(flatCoordinates, 0, flatCoordinates.length, 4);
|
||||
expect(flatCoordinates).to.eql([
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
13, 14, 15, 16, 9, 10, 11, 12, 5, 6, 7, 8, 1, 2, 3, 4,
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,529 +8,74 @@ import {
|
||||
|
||||
describe('ol/geom/flat/simplify.js', function () {
|
||||
const flatCoordinates = [
|
||||
224.55,
|
||||
250.15,
|
||||
226.91,
|
||||
244.19,
|
||||
233.31,
|
||||
241.45,
|
||||
234.98,
|
||||
236.06,
|
||||
244.21,
|
||||
232.76,
|
||||
262.59,
|
||||
215.31,
|
||||
267.76,
|
||||
213.81,
|
||||
273.57,
|
||||
201.84,
|
||||
273.12,
|
||||
192.16,
|
||||
277.62,
|
||||
189.03,
|
||||
280.36,
|
||||
181.41,
|
||||
286.51,
|
||||
177.74,
|
||||
292.41,
|
||||
159.37,
|
||||
296.91,
|
||||
155.64,
|
||||
314.95,
|
||||
151.37,
|
||||
319.75,
|
||||
145.16,
|
||||
330.33,
|
||||
137.57,
|
||||
341.48,
|
||||
139.96,
|
||||
369.98,
|
||||
137.89,
|
||||
387.39,
|
||||
142.51,
|
||||
391.28,
|
||||
139.39,
|
||||
409.52,
|
||||
141.14,
|
||||
414.82,
|
||||
139.75,
|
||||
427.72,
|
||||
127.3,
|
||||
439.6,
|
||||
119.74,
|
||||
474.93,
|
||||
107.87,
|
||||
486.51,
|
||||
106.75,
|
||||
489.2,
|
||||
109.45,
|
||||
493.79,
|
||||
108.63,
|
||||
504.74,
|
||||
119.66,
|
||||
512.96,
|
||||
122.35,
|
||||
518.63,
|
||||
120.89,
|
||||
524.09,
|
||||
126.88,
|
||||
529.57,
|
||||
127.86,
|
||||
534.21,
|
||||
140.93,
|
||||
539.27,
|
||||
147.24,
|
||||
567.69,
|
||||
148.91,
|
||||
575.25,
|
||||
157.26,
|
||||
580.62,
|
||||
158.15,
|
||||
601.53,
|
||||
156.85,
|
||||
617.74,
|
||||
159.86,
|
||||
622.0,
|
||||
167.04,
|
||||
629.55,
|
||||
194.6,
|
||||
638.9,
|
||||
195.61,
|
||||
641.26,
|
||||
200.81,
|
||||
651.77,
|
||||
204.56,
|
||||
671.55,
|
||||
222.55,
|
||||
683.68,
|
||||
217.45,
|
||||
695.25,
|
||||
219.15,
|
||||
700.64,
|
||||
217.98,
|
||||
703.12,
|
||||
214.36,
|
||||
712.26,
|
||||
215.87,
|
||||
721.49,
|
||||
212.81,
|
||||
727.81,
|
||||
213.36,
|
||||
729.98,
|
||||
208.73,
|
||||
735.32,
|
||||
208.2,
|
||||
739.94,
|
||||
204.77,
|
||||
769.98,
|
||||
208.42,
|
||||
779.6,
|
||||
216.87,
|
||||
784.2,
|
||||
218.16,
|
||||
800.24,
|
||||
214.62,
|
||||
810.53,
|
||||
219.73,
|
||||
817.19,
|
||||
226.82,
|
||||
820.77,
|
||||
236.17,
|
||||
827.23,
|
||||
236.16,
|
||||
829.89,
|
||||
239.89,
|
||||
851.0,
|
||||
248.94,
|
||||
859.88,
|
||||
255.49,
|
||||
865.21,
|
||||
268.53,
|
||||
857.95,
|
||||
280.3,
|
||||
865.48,
|
||||
291.45,
|
||||
866.81,
|
||||
298.66,
|
||||
864.68,
|
||||
302.71,
|
||||
867.79,
|
||||
306.17,
|
||||
859.87,
|
||||
311.37,
|
||||
860.08,
|
||||
314.35,
|
||||
858.29,
|
||||
314.94,
|
||||
858.1,
|
||||
327.6,
|
||||
854.54,
|
||||
335.4,
|
||||
860.92,
|
||||
343.0,
|
||||
856.43,
|
||||
350.15,
|
||||
851.42,
|
||||
352.96,
|
||||
849.84,
|
||||
359.59,
|
||||
854.56,
|
||||
365.53,
|
||||
849.74,
|
||||
370.38,
|
||||
844.09,
|
||||
371.89,
|
||||
844.75,
|
||||
380.44,
|
||||
841.52,
|
||||
383.67,
|
||||
839.57,
|
||||
390.4,
|
||||
845.59,
|
||||
399.05,
|
||||
848.4,
|
||||
407.55,
|
||||
843.71,
|
||||
411.3,
|
||||
844.09,
|
||||
419.88,
|
||||
839.51,
|
||||
432.76,
|
||||
841.33,
|
||||
441.04,
|
||||
847.62,
|
||||
449.22,
|
||||
847.16,
|
||||
458.44,
|
||||
851.38,
|
||||
462.79,
|
||||
853.97,
|
||||
471.15,
|
||||
866.36,
|
||||
480.77,
|
||||
224.55, 250.15, 226.91, 244.19, 233.31, 241.45, 234.98, 236.06, 244.21,
|
||||
232.76, 262.59, 215.31, 267.76, 213.81, 273.57, 201.84, 273.12, 192.16,
|
||||
277.62, 189.03, 280.36, 181.41, 286.51, 177.74, 292.41, 159.37, 296.91,
|
||||
155.64, 314.95, 151.37, 319.75, 145.16, 330.33, 137.57, 341.48, 139.96,
|
||||
369.98, 137.89, 387.39, 142.51, 391.28, 139.39, 409.52, 141.14, 414.82,
|
||||
139.75, 427.72, 127.3, 439.6, 119.74, 474.93, 107.87, 486.51, 106.75, 489.2,
|
||||
109.45, 493.79, 108.63, 504.74, 119.66, 512.96, 122.35, 518.63, 120.89,
|
||||
524.09, 126.88, 529.57, 127.86, 534.21, 140.93, 539.27, 147.24, 567.69,
|
||||
148.91, 575.25, 157.26, 580.62, 158.15, 601.53, 156.85, 617.74, 159.86,
|
||||
622.0, 167.04, 629.55, 194.6, 638.9, 195.61, 641.26, 200.81, 651.77, 204.56,
|
||||
671.55, 222.55, 683.68, 217.45, 695.25, 219.15, 700.64, 217.98, 703.12,
|
||||
214.36, 712.26, 215.87, 721.49, 212.81, 727.81, 213.36, 729.98, 208.73,
|
||||
735.32, 208.2, 739.94, 204.77, 769.98, 208.42, 779.6, 216.87, 784.2, 218.16,
|
||||
800.24, 214.62, 810.53, 219.73, 817.19, 226.82, 820.77, 236.17, 827.23,
|
||||
236.16, 829.89, 239.89, 851.0, 248.94, 859.88, 255.49, 865.21, 268.53,
|
||||
857.95, 280.3, 865.48, 291.45, 866.81, 298.66, 864.68, 302.71, 867.79,
|
||||
306.17, 859.87, 311.37, 860.08, 314.35, 858.29, 314.94, 858.1, 327.6,
|
||||
854.54, 335.4, 860.92, 343.0, 856.43, 350.15, 851.42, 352.96, 849.84,
|
||||
359.59, 854.56, 365.53, 849.74, 370.38, 844.09, 371.89, 844.75, 380.44,
|
||||
841.52, 383.67, 839.57, 390.4, 845.59, 399.05, 848.4, 407.55, 843.71, 411.3,
|
||||
844.09, 419.88, 839.51, 432.76, 841.33, 441.04, 847.62, 449.22, 847.16,
|
||||
458.44, 851.38, 462.79, 853.97, 471.15, 866.36, 480.77,
|
||||
];
|
||||
|
||||
const simplifiedRadiallyFlatCoordinates = [
|
||||
224.55,
|
||||
250.15,
|
||||
226.91,
|
||||
244.19,
|
||||
233.31,
|
||||
241.45,
|
||||
234.98,
|
||||
236.06,
|
||||
244.21,
|
||||
232.76,
|
||||
262.59,
|
||||
215.31,
|
||||
267.76,
|
||||
213.81,
|
||||
273.57,
|
||||
201.84,
|
||||
273.12,
|
||||
192.16,
|
||||
277.62,
|
||||
189.03,
|
||||
280.36,
|
||||
181.41,
|
||||
286.51,
|
||||
177.74,
|
||||
292.41,
|
||||
159.37,
|
||||
296.91,
|
||||
155.64,
|
||||
314.95,
|
||||
151.37,
|
||||
319.75,
|
||||
145.16,
|
||||
330.33,
|
||||
137.57,
|
||||
341.48,
|
||||
139.96,
|
||||
369.98,
|
||||
137.89,
|
||||
387.39,
|
||||
142.51,
|
||||
409.52,
|
||||
141.14,
|
||||
414.82,
|
||||
139.75,
|
||||
427.72,
|
||||
127.3,
|
||||
439.6,
|
||||
119.74,
|
||||
474.93,
|
||||
107.87,
|
||||
486.51,
|
||||
106.75,
|
||||
493.79,
|
||||
108.63,
|
||||
504.74,
|
||||
119.66,
|
||||
512.96,
|
||||
122.35,
|
||||
518.63,
|
||||
120.89,
|
||||
524.09,
|
||||
126.88,
|
||||
529.57,
|
||||
127.86,
|
||||
534.21,
|
||||
140.93,
|
||||
539.27,
|
||||
147.24,
|
||||
567.69,
|
||||
148.91,
|
||||
575.25,
|
||||
157.26,
|
||||
580.62,
|
||||
158.15,
|
||||
601.53,
|
||||
156.85,
|
||||
617.74,
|
||||
159.86,
|
||||
622.0,
|
||||
167.04,
|
||||
629.55,
|
||||
194.6,
|
||||
638.9,
|
||||
195.61,
|
||||
641.26,
|
||||
200.81,
|
||||
651.77,
|
||||
204.56,
|
||||
671.55,
|
||||
222.55,
|
||||
683.68,
|
||||
217.45,
|
||||
695.25,
|
||||
219.15,
|
||||
700.64,
|
||||
217.98,
|
||||
712.26,
|
||||
215.87,
|
||||
721.49,
|
||||
212.81,
|
||||
727.81,
|
||||
213.36,
|
||||
729.98,
|
||||
208.73,
|
||||
735.32,
|
||||
208.2,
|
||||
739.94,
|
||||
204.77,
|
||||
769.98,
|
||||
208.42,
|
||||
779.6,
|
||||
216.87,
|
||||
800.24,
|
||||
214.62,
|
||||
810.53,
|
||||
219.73,
|
||||
817.19,
|
||||
226.82,
|
||||
820.77,
|
||||
236.17,
|
||||
827.23,
|
||||
236.16,
|
||||
851.0,
|
||||
248.94,
|
||||
859.88,
|
||||
255.49,
|
||||
865.21,
|
||||
268.53,
|
||||
857.95,
|
||||
280.3,
|
||||
865.48,
|
||||
291.45,
|
||||
866.81,
|
||||
298.66,
|
||||
867.79,
|
||||
306.17,
|
||||
859.87,
|
||||
311.37,
|
||||
858.1,
|
||||
327.6,
|
||||
854.54,
|
||||
335.4,
|
||||
860.92,
|
||||
343.0,
|
||||
856.43,
|
||||
350.15,
|
||||
851.42,
|
||||
352.96,
|
||||
849.84,
|
||||
359.59,
|
||||
854.56,
|
||||
365.53,
|
||||
849.74,
|
||||
370.38,
|
||||
844.09,
|
||||
371.89,
|
||||
844.75,
|
||||
380.44,
|
||||
839.57,
|
||||
390.4,
|
||||
845.59,
|
||||
399.05,
|
||||
848.4,
|
||||
407.55,
|
||||
843.71,
|
||||
411.3,
|
||||
844.09,
|
||||
419.88,
|
||||
839.51,
|
||||
432.76,
|
||||
841.33,
|
||||
441.04,
|
||||
847.62,
|
||||
449.22,
|
||||
847.16,
|
||||
458.44,
|
||||
851.38,
|
||||
462.79,
|
||||
853.97,
|
||||
471.15,
|
||||
866.36,
|
||||
224.55, 250.15, 226.91, 244.19, 233.31, 241.45, 234.98, 236.06, 244.21,
|
||||
232.76, 262.59, 215.31, 267.76, 213.81, 273.57, 201.84, 273.12, 192.16,
|
||||
277.62, 189.03, 280.36, 181.41, 286.51, 177.74, 292.41, 159.37, 296.91,
|
||||
155.64, 314.95, 151.37, 319.75, 145.16, 330.33, 137.57, 341.48, 139.96,
|
||||
369.98, 137.89, 387.39, 142.51, 409.52, 141.14, 414.82, 139.75, 427.72,
|
||||
127.3, 439.6, 119.74, 474.93, 107.87, 486.51, 106.75, 493.79, 108.63,
|
||||
504.74, 119.66, 512.96, 122.35, 518.63, 120.89, 524.09, 126.88, 529.57,
|
||||
127.86, 534.21, 140.93, 539.27, 147.24, 567.69, 148.91, 575.25, 157.26,
|
||||
580.62, 158.15, 601.53, 156.85, 617.74, 159.86, 622.0, 167.04, 629.55,
|
||||
194.6, 638.9, 195.61, 641.26, 200.81, 651.77, 204.56, 671.55, 222.55,
|
||||
683.68, 217.45, 695.25, 219.15, 700.64, 217.98, 712.26, 215.87, 721.49,
|
||||
212.81, 727.81, 213.36, 729.98, 208.73, 735.32, 208.2, 739.94, 204.77,
|
||||
769.98, 208.42, 779.6, 216.87, 800.24, 214.62, 810.53, 219.73, 817.19,
|
||||
226.82, 820.77, 236.17, 827.23, 236.16, 851.0, 248.94, 859.88, 255.49,
|
||||
865.21, 268.53, 857.95, 280.3, 865.48, 291.45, 866.81, 298.66, 867.79,
|
||||
306.17, 859.87, 311.37, 858.1, 327.6, 854.54, 335.4, 860.92, 343.0, 856.43,
|
||||
350.15, 851.42, 352.96, 849.84, 359.59, 854.56, 365.53, 849.74, 370.38,
|
||||
844.09, 371.89, 844.75, 380.44, 839.57, 390.4, 845.59, 399.05, 848.4,
|
||||
407.55, 843.71, 411.3, 844.09, 419.88, 839.51, 432.76, 841.33, 441.04,
|
||||
847.62, 449.22, 847.16, 458.44, 851.38, 462.79, 853.97, 471.15, 866.36,
|
||||
480.77,
|
||||
];
|
||||
|
||||
const simplifiedFlatCoordinates = [
|
||||
224.55,
|
||||
250.15,
|
||||
267.76,
|
||||
213.81,
|
||||
296.91,
|
||||
155.64,
|
||||
330.33,
|
||||
137.57,
|
||||
409.52,
|
||||
141.14,
|
||||
439.6,
|
||||
119.74,
|
||||
486.51,
|
||||
106.75,
|
||||
529.57,
|
||||
127.86,
|
||||
539.27,
|
||||
147.24,
|
||||
617.74,
|
||||
159.86,
|
||||
629.55,
|
||||
194.6,
|
||||
671.55,
|
||||
222.55,
|
||||
727.81,
|
||||
213.36,
|
||||
739.94,
|
||||
204.77,
|
||||
769.98,
|
||||
208.42,
|
||||
779.6,
|
||||
216.87,
|
||||
800.24,
|
||||
214.62,
|
||||
820.77,
|
||||
236.17,
|
||||
859.88,
|
||||
255.49,
|
||||
865.21,
|
||||
268.53,
|
||||
857.95,
|
||||
280.3,
|
||||
867.79,
|
||||
306.17,
|
||||
859.87,
|
||||
311.37,
|
||||
854.54,
|
||||
335.4,
|
||||
860.92,
|
||||
343.0,
|
||||
849.84,
|
||||
359.59,
|
||||
854.56,
|
||||
365.53,
|
||||
844.09,
|
||||
371.89,
|
||||
839.57,
|
||||
390.4,
|
||||
848.4,
|
||||
407.55,
|
||||
839.51,
|
||||
432.76,
|
||||
853.97,
|
||||
471.15,
|
||||
866.36,
|
||||
480.77,
|
||||
224.55, 250.15, 267.76, 213.81, 296.91, 155.64, 330.33, 137.57, 409.52,
|
||||
141.14, 439.6, 119.74, 486.51, 106.75, 529.57, 127.86, 539.27, 147.24,
|
||||
617.74, 159.86, 629.55, 194.6, 671.55, 222.55, 727.81, 213.36, 739.94,
|
||||
204.77, 769.98, 208.42, 779.6, 216.87, 800.24, 214.62, 820.77, 236.17,
|
||||
859.88, 255.49, 865.21, 268.53, 857.95, 280.3, 867.79, 306.17, 859.87,
|
||||
311.37, 854.54, 335.4, 860.92, 343.0, 849.84, 359.59, 854.56, 365.53,
|
||||
844.09, 371.89, 839.57, 390.4, 848.4, 407.55, 839.51, 432.76, 853.97,
|
||||
471.15, 866.36, 480.77,
|
||||
];
|
||||
|
||||
const simplifiedHighQualityFlatCoordinates = [
|
||||
224.55,
|
||||
250.15,
|
||||
267.76,
|
||||
213.81,
|
||||
296.91,
|
||||
155.64,
|
||||
330.33,
|
||||
137.57,
|
||||
409.52,
|
||||
141.14,
|
||||
439.6,
|
||||
119.74,
|
||||
486.51,
|
||||
106.75,
|
||||
529.57,
|
||||
127.86,
|
||||
539.27,
|
||||
147.24,
|
||||
617.74,
|
||||
159.86,
|
||||
629.55,
|
||||
194.6,
|
||||
671.55,
|
||||
222.55,
|
||||
727.81,
|
||||
213.36,
|
||||
739.94,
|
||||
204.77,
|
||||
769.98,
|
||||
208.42,
|
||||
784.2,
|
||||
218.16,
|
||||
800.24,
|
||||
214.62,
|
||||
820.77,
|
||||
236.17,
|
||||
859.88,
|
||||
255.49,
|
||||
865.21,
|
||||
268.53,
|
||||
857.95,
|
||||
280.3,
|
||||
867.79,
|
||||
306.17,
|
||||
858.29,
|
||||
314.94,
|
||||
854.54,
|
||||
335.4,
|
||||
860.92,
|
||||
343.0,
|
||||
849.84,
|
||||
359.59,
|
||||
854.56,
|
||||
365.53,
|
||||
844.09,
|
||||
371.89,
|
||||
839.57,
|
||||
390.4,
|
||||
848.4,
|
||||
407.55,
|
||||
839.51,
|
||||
432.76,
|
||||
853.97,
|
||||
471.15,
|
||||
866.36,
|
||||
480.77,
|
||||
224.55, 250.15, 267.76, 213.81, 296.91, 155.64, 330.33, 137.57, 409.52,
|
||||
141.14, 439.6, 119.74, 486.51, 106.75, 529.57, 127.86, 539.27, 147.24,
|
||||
617.74, 159.86, 629.55, 194.6, 671.55, 222.55, 727.81, 213.36, 739.94,
|
||||
204.77, 769.98, 208.42, 784.2, 218.16, 800.24, 214.62, 820.77, 236.17,
|
||||
859.88, 255.49, 865.21, 268.53, 857.95, 280.3, 867.79, 306.17, 858.29,
|
||||
314.94, 854.54, 335.4, 860.92, 343.0, 849.84, 359.59, 854.56, 365.53,
|
||||
844.09, 371.89, 839.57, 390.4, 848.4, 407.55, 839.51, 432.76, 853.97,
|
||||
471.15, 866.36, 480.77,
|
||||
];
|
||||
|
||||
describe('simplifyLineString', function () {
|
||||
|
||||
@@ -35,24 +35,7 @@ describe('ol/geom/flat/straightchunk.js', function () {
|
||||
|
||||
describe('longer line string', function () {
|
||||
const flatCoords = [
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
-1,
|
||||
0,
|
||||
-1,
|
||||
2,
|
||||
-2,
|
||||
4,
|
||||
0, 0, 1, 0, 1, 1, 0, 1, 0, -1, -1, -1, -1, 0, -1, 2, -2, 4,
|
||||
];
|
||||
const stride = 2;
|
||||
|
||||
|
||||
@@ -32,11 +32,7 @@ describe('ol/geom/flat/transform.js', function () {
|
||||
],
|
||||
]).transform('EPSG:4326', 'EPSG:3857');
|
||||
const transform = [
|
||||
0.0004088332670837288,
|
||||
0,
|
||||
0,
|
||||
-0.0004088332670837288,
|
||||
4480.991370439071,
|
||||
0.0004088332670837288, 0, 0, -0.0004088332670837288, 4480.991370439071,
|
||||
1529.5752568707105,
|
||||
];
|
||||
const pixelCoordinates = transformGeom2D(
|
||||
@@ -112,36 +108,8 @@ describe('ol/geom/flat/transform.js', function () {
|
||||
flatCoordinates
|
||||
);
|
||||
expect(flatCoordinates).to.eql([
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
1,
|
||||
3,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
3,
|
||||
5,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
3,
|
||||
4,
|
||||
4,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
3,
|
||||
1, 2, 2, 1, 3, 2, 2, 3, 2, 2, 2, 2, 1, 2, 2, 3, 4, 3, 3, 5, 3, 4, 5, 3,
|
||||
4, 4, 3, 3, 4, 3,
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -673,12 +673,8 @@ describe('ol/proj.js', function () {
|
||||
expect(typeof transform).to.be('function');
|
||||
|
||||
const output = transform([
|
||||
-626172.13571216376,
|
||||
6887893.4928337997,
|
||||
-12000000,
|
||||
5000000,
|
||||
-626172.13571216376,
|
||||
6887893.4928337997,
|
||||
-626172.13571216376, 6887893.4928337997, -12000000, 5000000,
|
||||
-626172.13571216376, 6887893.4928337997,
|
||||
]);
|
||||
|
||||
expect(output[0]).to.roughlyEqual(-5.625, 1e-9);
|
||||
@@ -710,15 +706,8 @@ describe('ol/proj.js', function () {
|
||||
const dimension = 3;
|
||||
const output = transform(
|
||||
[
|
||||
-626172.13571216376,
|
||||
6887893.4928337997,
|
||||
100,
|
||||
-12000000,
|
||||
5000000,
|
||||
200,
|
||||
-626172.13571216376,
|
||||
6887893.4928337997,
|
||||
300,
|
||||
-626172.13571216376, 6887893.4928337997, 100, -12000000, 5000000, 200,
|
||||
-626172.13571216376, 6887893.4928337997, 300,
|
||||
],
|
||||
undefined,
|
||||
dimension
|
||||
|
||||
@@ -328,9 +328,7 @@ describe('ol/tilegrid/TileGrid.js', function () {
|
||||
beforeEach(function () {
|
||||
tileGrid = new TileGrid({
|
||||
extent: [
|
||||
343870.8496458133,
|
||||
5809157.009546259,
|
||||
1905238.0275122682,
|
||||
343870.8496458133, 5809157.009546259, 1905238.0275122682,
|
||||
7515502.7821859205,
|
||||
],
|
||||
sizes: [
|
||||
@@ -340,9 +338,7 @@ describe('ol/tilegrid/TileGrid.js', function () {
|
||||
[11, 16],
|
||||
],
|
||||
resolutions: [
|
||||
4174.778550445067,
|
||||
2087.3892752225333,
|
||||
1043.6946376112667,
|
||||
4174.778550445067, 2087.3892752225333, 1043.6946376112667,
|
||||
521.8473188056333,
|
||||
],
|
||||
tileSizes: [
|
||||
|
||||
@@ -13,22 +13,7 @@ describe('ol/vec/mat4.js', function () {
|
||||
const transform = [1, 2, 3, 4, 5, 6];
|
||||
const result = create();
|
||||
expect(fromTransform(result, transform)).to.eql([
|
||||
1,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
3,
|
||||
4,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
5,
|
||||
6,
|
||||
0,
|
||||
1,
|
||||
1, 2, 0, 0, 3, 4, 0, 0, 0, 0, 1, 0, 5, 6, 0, 1,
|
||||
]);
|
||||
expect(result).to.eql([1, 2, 0, 0, 3, 4, 0, 0, 0, 0, 1, 0, 5, 6, 0, 1]);
|
||||
});
|
||||
|
||||
@@ -12,36 +12,8 @@ import View from '../../../../src/ol/View.js';
|
||||
const vectorSource = new VectorSource();
|
||||
|
||||
const nicePath = [
|
||||
20,
|
||||
33,
|
||||
40,
|
||||
31,
|
||||
60,
|
||||
30,
|
||||
80,
|
||||
31,
|
||||
100,
|
||||
33,
|
||||
120,
|
||||
37,
|
||||
140,
|
||||
39,
|
||||
160,
|
||||
40,
|
||||
180,
|
||||
39,
|
||||
200,
|
||||
37,
|
||||
220,
|
||||
33,
|
||||
240,
|
||||
31,
|
||||
260,
|
||||
30,
|
||||
280,
|
||||
31,
|
||||
300,
|
||||
33,
|
||||
20, 33, 40, 31, 60, 30, 80, 31, 100, 33, 120, 37, 140, 39, 160, 40, 180, 39,
|
||||
200, 37, 220, 33, 240, 31, 260, 30, 280, 31, 300, 33,
|
||||
];
|
||||
|
||||
const lineString1 = new LineString(nicePath, 'XY');
|
||||
|
||||
@@ -11,36 +11,8 @@ import VectorSource from '../../../../src/ol/source/Vector.js';
|
||||
import View from '../../../../src/ol/View.js';
|
||||
|
||||
const nicePath = [
|
||||
20,
|
||||
33,
|
||||
40,
|
||||
31,
|
||||
60,
|
||||
30,
|
||||
80,
|
||||
31,
|
||||
100,
|
||||
33,
|
||||
120,
|
||||
37,
|
||||
140,
|
||||
39,
|
||||
160,
|
||||
40,
|
||||
180,
|
||||
39,
|
||||
200,
|
||||
37,
|
||||
220,
|
||||
33,
|
||||
240,
|
||||
31,
|
||||
260,
|
||||
30,
|
||||
280,
|
||||
31,
|
||||
300,
|
||||
33,
|
||||
20, 33, 40, 31, 60, 30, 80, 31, 100, 33, 120, 37, 140, 39, 160, 40, 180, 39,
|
||||
200, 37, 220, 33, 240, 31, 260, 30, 280, 31, 300, 33,
|
||||
];
|
||||
|
||||
const vectorSource = new VectorSource();
|
||||
|
||||
Reference in New Issue
Block a user