ol/geom/flat/length export

This commit is contained in:
raiyni
2018-02-12 23:27:38 -06:00
parent fb548b1b45
commit 05a648d4f3
5 changed files with 24 additions and 26 deletions

View File

@@ -1,4 +1,4 @@
import _ol_geom_flat_length_ from '../../../../../src/ol/geom/flat/length.js';
import {lineStringLength, linearRingLength} from '../../../../../src/ol/geom/flat/length.js';
describe('ol.geom.flat.length', function() {
@@ -13,7 +13,7 @@ describe('ol.geom.flat.length', function() {
const offset = 0;
const end = 8;
const expected = 3;
const got = _ol_geom_flat_length_.lineString(flatCoords, offset, end, stride);
const got = lineStringLength(flatCoords, offset, end, stride);
expect(got).to.be(expected);
});
@@ -21,7 +21,7 @@ describe('ol.geom.flat.length', function() {
const offset = 2;
const end = 8;
const expected = 2;
const got = _ol_geom_flat_length_.lineString(flatCoords, offset, end, stride);
const got = lineStringLength(flatCoords, offset, end, stride);
expect(got).to.be(expected);
});
@@ -29,7 +29,7 @@ describe('ol.geom.flat.length', function() {
const offset = 0;
const end = 4;
const expected = 1;
const got = _ol_geom_flat_length_.lineString(flatCoords, offset, end, stride);
const got = lineStringLength(flatCoords, offset, end, stride);
expect(got).to.be(expected);
});
@@ -43,7 +43,7 @@ describe('ol.geom.flat.length', function() {
const offset = 0;
const end = 12;
const expected = 3;
const got = _ol_geom_flat_length_.lineString(flatCoords, offset, end, stride);
const got = lineStringLength(flatCoords, offset, end, stride);
expect(got).to.be(expected);
});
@@ -51,7 +51,7 @@ describe('ol.geom.flat.length', function() {
const offset = 3;
const end = 12;
const expected = 2;
const got = _ol_geom_flat_length_.lineString(flatCoords, offset, end, stride);
const got = lineStringLength(flatCoords, offset, end, stride);
expect(got).to.be(expected);
});
@@ -59,7 +59,7 @@ describe('ol.geom.flat.length', function() {
const offset = 0;
const end = 6;
const expected = 1;
const got = _ol_geom_flat_length_.lineString(flatCoords, offset, end, stride);
const got = lineStringLength(flatCoords, offset, end, stride);
expect(got).to.be(expected);
});
@@ -74,7 +74,7 @@ describe('ol.geom.flat.length', function() {
const offset = 0;
const end = 8;
const expected = 4;
const got = _ol_geom_flat_length_.linearRing(flatCoords, offset, end, stride);
const got = linearRingLength(flatCoords, offset, end, stride);
expect(got).to.be(expected);
});
@@ -84,7 +84,7 @@ describe('ol.geom.flat.length', function() {
const offset = 0;
const end = 14;
const expected = 8;
const got = _ol_geom_flat_length_.linearRing(flatCoords, offset, end, stride);
const got = linearRingLength(flatCoords, offset, end, stride);
expect(got).to.be(expected);
});

View File

@@ -1,5 +1,5 @@
import _ol_geom_flat_textpath_ from '../../../../../src/ol/geom/flat/textpath.js';
import _ol_geom_flat_length_ from '../../../../../src/ol/geom/flat/length.js';
import {lineStringLength} from '../../../../../src/ol/geom/flat/length.js';
describe('textpath', function() {
@@ -67,7 +67,7 @@ describe('textpath', function() {
});
it('renders angled text', function() {
const length = _ol_geom_flat_length_.lineString(angled, 0, angled.length, 2);
const length = lineStringLength(angled, 0, angled.length, 2);
const startM = length / 2 - 15;
const instructions = _ol_geom_flat_textpath_.lineString(
angled, 0, angled.length, 2, 'foo', measure, startM, Infinity);
@@ -78,7 +78,7 @@ describe('textpath', function() {
});
it('respects maxAngle', function() {
const length = _ol_geom_flat_length_.lineString(angled, 0, angled.length, 2);
const length = lineStringLength(angled, 0, angled.length, 2);
const startM = length / 2 - 15;
const instructions = _ol_geom_flat_textpath_.lineString(
angled, 0, angled.length, 2, 'foo', measure, startM, Math.PI / 4);
@@ -86,7 +86,7 @@ describe('textpath', function() {
});
it('uses the smallest angle for maxAngleDelta', function() {
const length = _ol_geom_flat_length_.lineString(reverseangled, 0, reverseangled.length, 2);
const length = lineStringLength(reverseangled, 0, reverseangled.length, 2);
const startM = length / 2 - 15;
const instructions = _ol_geom_flat_textpath_.lineString(
reverseangled, 0, reverseangled.length, 2, 'foo', measure, startM, Math.PI);
@@ -94,7 +94,7 @@ describe('textpath', function() {
});
it('respects the offset option', function() {
const length = _ol_geom_flat_length_.lineString(angled, 2, angled.length, 2);
const length = lineStringLength(angled, 2, angled.length, 2);
const startM = length / 2 - 15;
const instructions = _ol_geom_flat_textpath_.lineString(
angled, 2, angled.length, 2, 'foo', measure, startM, Infinity);
@@ -103,7 +103,7 @@ describe('textpath', function() {
});
it('respects the end option', function() {
const length = _ol_geom_flat_length_.lineString(angled, 0, 4, 2);
const length = lineStringLength(angled, 0, 4, 2);
const startM = length / 2 - 15;
const instructions = _ol_geom_flat_textpath_.lineString(
angled, 0, 4, 2, 'foo', measure, startM, Infinity);