Rename _ol_geom_LineString_ to LineString

This commit is contained in:
Tim Schaub
2017-12-14 08:54:53 -07:00
parent ad5806c29d
commit f7b3876c1b
55 changed files with 270 additions and 270 deletions

View File

@@ -3,7 +3,7 @@ import _ol_Map_ from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import _ol_format_GeoJSON_ from '../../../../src/ol/format/GeoJSON.js';
import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
@@ -58,7 +58,7 @@ describe('ol.rendering.layer.Vector', function() {
}
function addLineString(r) {
source.addFeature(new _ol_Feature_(new _ol_geom_LineString_([
source.addFeature(new _ol_Feature_(new LineString([
[center[0] - r, center[1] - r],
[center[0] + r, center[1] - r],
[center[0] + r, center[1] + r],
@@ -75,7 +75,7 @@ describe('ol.rendering.layer.Vector', function() {
it('renders opacity correctly with the canvas renderer', function(done) {
createMap('canvas');
var smallLine = new _ol_Feature_(new _ol_geom_LineString_([
var smallLine = new _ol_Feature_(new LineString([
[center[0], center[1] - 1],
[center[0], center[1] + 1]
]));
@@ -101,7 +101,7 @@ describe('ol.rendering.layer.Vector', function() {
it('renders opacity correctly with renderMode: \'image\'', function(done) {
createMap('canvas');
var smallLine = new _ol_Feature_(new _ol_geom_LineString_([
var smallLine = new _ol_Feature_(new LineString([
[center[0], center[1] - 1],
[center[0], center[1] + 1]
]));
@@ -128,7 +128,7 @@ describe('ol.rendering.layer.Vector', function() {
it('renders transparent layers correctly with the canvas renderer', function(done) {
createMap('canvas');
var smallLine = new _ol_Feature_(new _ol_geom_LineString_([
var smallLine = new _ol_Feature_(new LineString([
[center[0], center[1] - 1],
[center[0], center[1] + 1]
]));
@@ -141,7 +141,7 @@ describe('ol.rendering.layer.Vector', function() {
})
]);
source.addFeature(smallLine);
var smallLine2 = new _ol_Feature_(new _ol_geom_LineString_([
var smallLine2 = new _ol_Feature_(new LineString([
[center[0], center[1] - 1000],
[center[0], center[1] + 1000]
]));
@@ -167,7 +167,7 @@ describe('ol.rendering.layer.Vector', function() {
it('renders transparent layers correctly with renderMode: \'image\'', function(done) {
createMap('canvas');
var smallLine = new _ol_Feature_(new _ol_geom_LineString_([
var smallLine = new _ol_Feature_(new LineString([
[center[0], center[1] - 1],
[center[0], center[1] + 1]
]));
@@ -180,7 +180,7 @@ describe('ol.rendering.layer.Vector', function() {
})
]);
source.addFeature(smallLine);
var smallLine2 = new _ol_Feature_(new _ol_geom_LineString_([
var smallLine2 = new _ol_Feature_(new LineString([
[center[0], center[1] - 1000],
[center[0], center[1] + 1000]
]));
@@ -881,7 +881,7 @@ describe('ol.rendering.layer.Vector', function() {
})
})
}));
var line = new _ol_Feature_(new _ol_geom_LineString_([
var line = new _ol_Feature_(new LineString([
[center[0] - 650, center[1] - 200],
[center[0] + 650, center[1] - 200]
]));
@@ -924,7 +924,7 @@ describe('ol.rendering.layer.Vector', function() {
})
})
}));
var line = new _ol_Feature_(new _ol_geom_LineString_([
var line = new _ol_Feature_(new LineString([
[center[0] - 650, center[1] - 200],
[center[0] + 650, center[1] - 200]
]));
@@ -968,7 +968,7 @@ describe('ol.rendering.layer.Vector', function() {
})
})
}));
var line = new _ol_Feature_(new _ol_geom_LineString_([
var line = new _ol_Feature_(new LineString([
[center[0] - 650, center[1] - 200],
[center[0] + 650, center[1] - 200]
]));

View File

@@ -1,4 +1,4 @@
import _ol_geom_LineString_ from '../../../src/ol/geom/LineString.js';
import LineString from '../../../src/ol/geom/LineString.js';
import Point from '../../../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../../../src/ol/geom/Polygon.js';
import _ol_render_ from '../../../src/ol/render.js';
@@ -65,7 +65,7 @@ describe('ol.render', function() {
});
vectorContext.setStyle(style);
vectorContext.drawGeometry(new _ol_geom_LineString_([
vectorContext.drawGeometry(new LineString([
[10, 60], [30, 40], [50, 60], [70, 40], [90, 60]
]));
@@ -90,7 +90,7 @@ describe('ol.render', function() {
});
vectorContext.setStyle(style);
vectorContext.drawGeometry(new _ol_geom_LineString_([
vectorContext.drawGeometry(new LineString([
[10, 60], [30, 40], [50, 60], [70, 40], [90, 60]
]));
@@ -115,7 +115,7 @@ describe('ol.render', function() {
});
vectorContext.setStyle(style);
vectorContext.drawGeometry(new _ol_geom_LineString_([
vectorContext.drawGeometry(new LineString([
[10, 60], [30, 40], [50, 60], [70, 40], [90, 60]
]));

View File

@@ -1,5 +1,5 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_Map_ from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
@@ -44,7 +44,7 @@ describe('ol.rendering.style.LineString', function() {
var feature;
feature = new _ol_Feature_({
geometry: new _ol_geom_LineString_(
geometry: new LineString(
[[-20, 20], [15, 20]]
)
});
@@ -54,7 +54,7 @@ describe('ol.rendering.style.LineString', function() {
vectorSource.addFeature(feature);
feature = new _ol_Feature_({
geometry: new _ol_geom_LineString_(
geometry: new LineString(
[[-20, 15], [15, 15]]
)
});
@@ -64,7 +64,7 @@ describe('ol.rendering.style.LineString', function() {
vectorSource.addFeature(feature);
feature = new _ol_Feature_({
geometry: new _ol_geom_LineString_(
geometry: new LineString(
[[-20, 10], [15, 10]]
)
});
@@ -76,7 +76,7 @@ describe('ol.rendering.style.LineString', function() {
vectorSource.addFeature(feature);
feature = new _ol_Feature_({
geometry: new _ol_geom_LineString_(
geometry: new LineString(
[[-20, -20], [-2, 0], [15, -20]]
)
});
@@ -92,7 +92,7 @@ describe('ol.rendering.style.LineString', function() {
vectorSource.addFeature(feature);
feature = new _ol_Feature_({
geometry: new _ol_geom_LineString_(
geometry: new LineString(
[[-20, -15], [-2, 5], [15, -15]]
)
});

View File

@@ -1,5 +1,5 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
import Point from '../../../../src/ol/geom/Point.js';
@@ -105,7 +105,7 @@ describe('ol.rendering.style.Text', function() {
var polygon = [151, 17, 163, 22, 159, 30, 150, 30, 143, 24, 151, 17];
function createLineString(coords, textAlign, maxAngle, strokeColor, strokeWidth, scale) {
var geom = new _ol_geom_LineString_();
var geom = new LineString();
geom.setFlatCoordinates('XY', coords);
var style = new _ol_style_Style_({
stroke: new _ol_style_Stroke_({
@@ -262,7 +262,7 @@ describe('ol.rendering.style.Text', function() {
it('renders text along a MultiLineString', function(done) {
createMap('canvas');
var line = new _ol_geom_LineString_();
var line = new LineString();
line.setFlatCoordinates('XY', nicePath);
var geom = new _ol_geom_MultiLineString_(null);
geom.appendLineString(line);

View File

@@ -1,7 +1,7 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import * as _ol_extent_ from '../../../../src/ol/extent.js';
import _ol_format_EsriJSON_ from '../../../../src/ol/format/EsriJSON.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
@@ -181,7 +181,7 @@ describe('ol.format.EsriJSON', function() {
var feature = format.readFeature(lineStringEsriJSON);
expect(feature).to.be.an(_ol_Feature_);
var geometry = feature.getGeometry();
expect(geometry).to.be.an(_ol_geom_LineString_);
expect(geometry).to.be.an(LineString);
expect(geometry.getCoordinates()).to.eql(
[[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]]);
expect(feature.get('prop0')).to.be('value0');
@@ -228,7 +228,7 @@ describe('ol.format.EsriJSON', function() {
var features = format.readFeatures(featureCollectionEsriJSON);
expect(features).to.have.length(3);
expect(features[0].getGeometry()).to.be.an(Point);
expect(features[1].getGeometry()).to.be.an(_ol_geom_LineString_);
expect(features[1].getGeometry()).to.be.an(LineString);
expect(features[2].getGeometry()).to.be.an(_ol_geom_Polygon_);
});
@@ -285,13 +285,13 @@ describe('ol.format.EsriJSON', function() {
expect(first).to.be.a(_ol_Feature_);
expect(first.get('LINK_ID')).to.be(573730499);
var firstGeom = first.getGeometry();
expect(firstGeom).to.be.a(_ol_geom_LineString_);
expect(firstGeom).to.be.a(LineString);
var second = array[1];
expect(second).to.be.a(_ol_Feature_);
expect(second.get('ST_NAME')).to.be('BRUNNSGATAN');
var secondGeom = second.getGeometry();
expect(secondGeom).to.be.a(_ol_geom_LineString_);
expect(secondGeom).to.be.a(LineString);
});
it('parses ksfields.geojson', function(done) {
@@ -435,7 +435,7 @@ describe('ol.format.EsriJSON', function() {
});
var obj = format.readGeometry(str);
expect(obj).to.be.a(_ol_geom_LineString_);
expect(obj).to.be.a(LineString);
expect(obj.getCoordinates()).to.eql([[10, 20], [30, 40]]);
expect(obj.getLayout()).to.eql('XY');
});
@@ -447,7 +447,7 @@ describe('ol.format.EsriJSON', function() {
});
var obj = format.readGeometry(str);
expect(obj).to.be.a(_ol_geom_LineString_);
expect(obj).to.be.a(LineString);
expect(obj.getLayout()).to.eql('XYZ');
expect(obj.getCoordinates()).to.eql([[10, 20, 1534], [30, 40, 1420]]);
});
@@ -459,7 +459,7 @@ describe('ol.format.EsriJSON', function() {
});
var obj = format.readGeometry(str);
expect(obj).to.be.a(_ol_geom_LineString_);
expect(obj).to.be.a(LineString);
expect(obj.getLayout()).to.eql('XYM');
expect(obj.getCoordinates()).to.eql([[10, 20, 1534], [30, 40, 1420]]);
});
@@ -472,7 +472,7 @@ describe('ol.format.EsriJSON', function() {
});
var obj = format.readGeometry(str);
expect(obj).to.be.a(_ol_geom_LineString_);
expect(obj).to.be.a(LineString);
expect(obj.getLayout()).to.eql('XYZM');
expect(obj.getCoordinates()).to.eql([[10, 20, 1534, 1],
[30, 40, 1420, 2]]);
@@ -751,7 +751,7 @@ describe('ol.format.EsriJSON', function() {
var second = features[1];
expect(second).to.be.a(_ol_Feature_);
expect(second.get('bam')).to.be('baz');
expect(second.getGeometry()).to.be.a(_ol_geom_LineString_);
expect(second.getGeometry()).to.be.a(LineString);
expect(format.readProjection(json)).to.be(getProjection('EPSG:3857'));
@@ -791,14 +791,14 @@ describe('ol.format.EsriJSON', function() {
});
it('encodes linestring', function() {
var linestring = new _ol_geom_LineString_([[10, 20], [30, 40]]);
var linestring = new LineString([[10, 20], [30, 40]]);
var esrijson = format.writeGeometry(linestring);
expect(linestring.getCoordinates()).to.eql(
format.readGeometry(esrijson).getCoordinates());
});
it('encodes XYZ linestring', function() {
var linestring = new _ol_geom_LineString_([[10, 20, 1534], [30, 40, 1420]],
var linestring = new LineString([[10, 20, 1534], [30, 40, 1420]],
'XYZ');
var esrijson = format.writeGeometry(linestring);
expect(linestring.getCoordinates()).to.eql(
@@ -806,7 +806,7 @@ describe('ol.format.EsriJSON', function() {
});
it('encodes XYM linestring', function() {
var linestring = new _ol_geom_LineString_([[10, 20, 1534], [30, 40, 1420]],
var linestring = new LineString([[10, 20, 1534], [30, 40, 1420]],
'XYM');
var esrijson = format.writeGeometry(linestring);
expect(linestring.getCoordinates()).to.eql(
@@ -814,7 +814,7 @@ describe('ol.format.EsriJSON', function() {
});
it('encodes XYZM linestring', function() {
var linestring = new _ol_geom_LineString_([[10, 20, 1534, 1],
var linestring = new LineString([[10, 20, 1534, 1],
[30, 40, 1420, 1]],
'XYZM');
var esrijson = format.writeGeometry(linestring);

View File

@@ -3,7 +3,7 @@ import * as _ol_extent_ from '../../../../src/ol/extent.js';
import _ol_format_GeoJSON_ from '../../../../src/ol/format/GeoJSON.js';
import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js';
import _ol_geom_GeometryCollection_ from '../../../../src/ol/geom/GeometryCollection.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
import Point from '../../../../src/ol/geom/Point.js';
@@ -164,7 +164,7 @@ describe('ol.format.GeoJSON', function() {
var feature = format.readFeature(lineStringGeoJSON);
expect(feature).to.be.an(_ol_Feature_);
var geometry = feature.getGeometry();
expect(geometry).to.be.an(_ol_geom_LineString_);
expect(geometry).to.be.an(LineString);
expect(geometry.getCoordinates()).to.eql(
[[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]]);
expect(feature.get('prop0')).to.be('value0');
@@ -201,7 +201,7 @@ describe('ol.format.GeoJSON', function() {
var features = format.readFeatures(featureCollectionGeoJSON);
expect(features).to.have.length(3);
expect(features[0].getGeometry()).to.be.an(Point);
expect(features[1].getGeometry()).to.be.an(_ol_geom_LineString_);
expect(features[1].getGeometry()).to.be.an(LineString);
expect(features[2].getGeometry()).to.be.an(_ol_geom_Polygon_);
});
@@ -274,13 +274,13 @@ describe('ol.format.GeoJSON', function() {
expect(first).to.be.a(_ol_Feature_);
expect(first.get('LINK_ID')).to.be(573730499);
var firstGeom = first.getGeometry();
expect(firstGeom).to.be.a(_ol_geom_LineString_);
expect(firstGeom).to.be.a(LineString);
var second = array[1];
expect(second).to.be.a(_ol_Feature_);
expect(second.get('ST_NAME')).to.be('BRUNNSGATAN');
var secondGeom = second.getGeometry();
expect(secondGeom).to.be.a(_ol_geom_LineString_);
expect(secondGeom).to.be.a(LineString);
});
it('can parse a polygon geometry as an array of one feature', function() {
@@ -340,7 +340,7 @@ describe('ol.format.GeoJSON', function() {
var first = features[0];
expect(first).to.be.a(_ol_Feature_);
expect(first.get('bam')).to.be('baz');
expect(first.getGeometry()).to.be.a(_ol_geom_LineString_);
expect(first.getGeometry()).to.be.a(LineString);
expect(format.readProjection(json)).to.be(getProjection('EPSG:4326'));
});
@@ -368,7 +368,7 @@ describe('ol.format.GeoJSON', function() {
});
var obj = format.readGeometry(str);
expect(obj).to.be.a(_ol_geom_LineString_);
expect(obj).to.be.a(LineString);
expect(obj.getCoordinates()).to.eql([[10, 20], [30, 40]]);
expect(obj.getLayout()).to.eql('XY');
});
@@ -380,7 +380,7 @@ describe('ol.format.GeoJSON', function() {
});
var obj = format.readGeometry(str);
expect(obj).to.be.a(_ol_geom_LineString_);
expect(obj).to.be.a(LineString);
expect(obj.getLayout()).to.eql('XYZ');
expect(obj.getCoordinates()).to.eql([[10, 20, 1534], [30, 40, 1420]]);
});
@@ -419,7 +419,7 @@ describe('ol.format.GeoJSON', function() {
expect(array.length).to.be(2);
expect(array[0]).to.be.a(Point);
expect(array[0].getLayout()).to.eql('XY');
expect(array[1]).to.be.a(_ol_geom_LineString_);
expect(array[1]).to.be.a(LineString);
expect(array[1].getLayout()).to.eql('XY');
});
@@ -469,7 +469,7 @@ describe('ol.format.GeoJSON', function() {
var second = features[1];
expect(second).to.be.a(_ol_Feature_);
expect(second.get('bam')).to.be('baz');
expect(second.getGeometry()).to.be.a(_ol_geom_LineString_);
expect(second.getGeometry()).to.be.a(LineString);
expect(format.readProjection(json)).to.be(getProjection('EPSG:3857'));
@@ -512,7 +512,7 @@ describe('ol.format.GeoJSON', function() {
var second = features[1];
expect(second).to.be.a(_ol_Feature_);
expect(second.get('bam')).to.be('baz');
expect(second.getGeometry()).to.be.a(_ol_geom_LineString_);
expect(second.getGeometry()).to.be.a(LineString);
expect(format.readProjection(json)).to.be(getProjection('EPSG:4326'));
@@ -612,7 +612,7 @@ describe('ol.format.GeoJSON', function() {
});
it('encodes linestring', function() {
var linestring = new _ol_geom_LineString_([[10, 20], [30, 40]]);
var linestring = new LineString([[10, 20], [30, 40]]);
var geojson = format.writeGeometry(linestring);
expect(linestring.getCoordinates()).to.eql(
format.readGeometry(geojson).getCoordinates());
@@ -731,7 +731,7 @@ describe('ol.format.GeoJSON', function() {
it('encodes geometry collection', function() {
var collection = new _ol_geom_GeometryCollection_([
new Point([10, 20]),
new _ol_geom_LineString_([[30, 40], [50, 60]])
new LineString([[30, 40], [50, 60]])
]);
var geojson = format.writeGeometry(collection);
var got = format.readGeometry(geojson);
@@ -772,7 +772,7 @@ describe('ol.format.GeoJSON', function() {
it('transforms and encodes geometry collection', function() {
var collection = new _ol_geom_GeometryCollection_([
new Point([2, 3]),
new _ol_geom_LineString_([[3, 2], [2, 1]])
new LineString([[3, 2], [2, 1]])
]);
var geojson = format.writeGeometry(collection, {
featureProjection: 'EPSG:3857'
@@ -803,7 +803,7 @@ describe('ol.format.GeoJSON', function() {
});
it('truncates a linestring with decimals option', function() {
var linestring = new _ol_geom_LineString_([[42.123456789, 38.987654321],
var linestring = new LineString([[42.123456789, 38.987654321],
[43, 39]]);
var geojson = format.writeGeometry(linestring, {
decimals: 6
@@ -815,7 +815,7 @@ describe('ol.format.GeoJSON', function() {
});
it('rounds a linestring with decimals option = 0', function() {
var linestring = new _ol_geom_LineString_([[42.123456789, 38.987654321],
var linestring = new LineString([[42.123456789, 38.987654321],
[43, 39]]);
var geojson = format.writeGeometry(linestring, {
decimals: 0

View File

@@ -1,7 +1,7 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_format_GML_ from '../../../../src/ol/format/GML.js';
import _ol_format_GML2_ from '../../../../src/ol/format/GML2.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
@@ -164,7 +164,7 @@ describe('ol.format.GML2', function() {
' </layer>';
var feature = new _ol_Feature_({
geometry: new _ol_geom_LineString_([[1.1, 2], [3, 4.2]])
geometry: new LineString([[1.1, 2], [3, 4.2]])
});
feature.setId(1);
var objectStack = [{
@@ -442,7 +442,7 @@ describe('ol.format.GML3', function() {
' <gml:posList srsDimension="2">1 2 3 4</gml:posList>' +
'</gml:LineString>';
var g = readGeometry(format, text);
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
expect(g.getCoordinates()).to.eql([[1, 2, 0], [3, 4, 0]]);
var serialized = format.writeGeometryNode(g);
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
@@ -459,7 +459,7 @@ describe('ol.format.GML3', function() {
' <gml:posList>1 2 3 4</gml:posList>' +
'</gml:LineString>';
var g = readGeometry(format, text, config);
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
var coordinates = g.getCoordinates();
expect(coordinates[0].slice(0, 2)).to.eql(
transform([1, 2], 'CRS:84', 'EPSG:3857'));
@@ -481,7 +481,7 @@ describe('ol.format.GML3', function() {
' <gml:posList srsDimension="2">2 1 4 3</gml:posList>' +
'</gml:LineString>';
var g = readGeometry(formatWGS84, text);
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
expect(g.getCoordinates()).to.eql([[1, 2, 0], [3, 4, 0]]);
var serialized = formatWGS84.writeGeometryNode(g);
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
@@ -500,7 +500,7 @@ describe('ol.format.GML3', function() {
' <gml:posList srsDimension="2">-90 -180 90 180</gml:posList>' +
'</gml:LineString>';
var g = readGeometry(format, text);
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
expect(g.getCoordinates()).to.eql([[-180, -90, 0], [180, 90, 0]]);
var serialized = formatWGS84.writeGeometryNode(g);
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
@@ -563,7 +563,7 @@ describe('ol.format.GML3', function() {
' <gml:posList>1 2 3 4 5 6</gml:posList>' +
'</gml:LineString>';
var g = readGeometry(format, text);
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
expect(g.getCoordinates()).to.eql([[1, 2, 3], [4, 5, 6]]);
});
@@ -677,7 +677,7 @@ describe('ol.format.GML3', function() {
' </gml:segments>' +
'</gml:Curve>';
var g = readGeometry(format, text);
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
expect(g.getCoordinates()).to.eql([[1, 2, 0], [3, 4, 0]]);
format = new _ol_format_GML_({srsName: 'CRS:84', curve: true});
var serialized = format.writeGeometryNode(g);
@@ -1522,7 +1522,7 @@ describe('ol.format.GML3', function() {
it('creates a LineString', function() {
feature = features[0];
expect(feature.getId()).to.equal('geoserver_layer.1');
expect(feature.getGeometry()).to.be.an(_ol_geom_LineString_);
expect(feature.getGeometry()).to.be.an(LineString);
});
it('creates a Polygon', function() {

View File

@@ -1,6 +1,6 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_format_GPX_ from '../../../../src/ol/format/GPX.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
@@ -38,7 +38,7 @@ describe('ol.format.GPX', function() {
var f = fs[0];
expect(f).to.be.an(_ol_Feature_);
var g = f.getGeometry();
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
expect(g.getCoordinates()).to.eql([]);
expect(g.getLayout()).to.be('XY');
});
@@ -95,7 +95,7 @@ describe('ol.format.GPX', function() {
var f = fs[0];
expect(f).to.be.an(_ol_Feature_);
var g = f.getGeometry();
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
expect(g.getCoordinates()).to.eql([[2, 1], [4, 3]]);
expect(g.getLayout()).to.be('XY');
var serialized = format.writeFeaturesNode(fs);
@@ -120,7 +120,7 @@ describe('ol.format.GPX', function() {
var f = fs[0];
expect(f).to.be.an(_ol_Feature_);
var g = f.getGeometry();
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
var p1 = transform([2, 1], 'EPSG:4326', 'EPSG:3857');
var p2 = transform([6, 5], 'EPSG:4326', 'EPSG:3857');
expect(g.getCoordinates()).to.eql([p1, p2]);

View File

@@ -3,7 +3,7 @@ import _ol_array_ from '../../../../src/ol/array.js';
import _ol_format_GeoJSON_ from '../../../../src/ol/format/GeoJSON.js';
import _ol_format_KML_ from '../../../../src/ol/format/KML.js';
import _ol_geom_GeometryCollection_ from '../../../../src/ol/geom/GeometryCollection.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
@@ -194,7 +194,7 @@ describe('ol.format.KML', function() {
it('can write properties', function() {
var lineString = new _ol_geom_LineString_([[1, 2], [3, 4]]);
var lineString = new LineString([[1, 2], [3, 4]]);
lineString.set('extrude', false);
lineString.set('tessellate', true);
lineString.set('altitudeMode', 'clampToGround');
@@ -449,7 +449,7 @@ describe('ol.format.KML', function() {
var f = fs[0];
expect(f).to.be.an(_ol_Feature_);
var g = f.getGeometry();
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
expect(g.getCoordinates()).to.eql([[1, 2, 3], [4, 5, 6]]);
expect(g.get('extrude')).to.be(false);
expect(g.get('tessellate')).to.be(true);
@@ -458,7 +458,7 @@ describe('ol.format.KML', function() {
it('can write XY LineString geometries', function() {
var layout = 'XY';
var lineString = new _ol_geom_LineString_([[1, 2], [3, 4]], layout);
var lineString = new LineString([[1, 2], [3, 4]], layout);
var features = [new _ol_Feature_(lineString)];
var node = format.writeFeaturesNode(features);
var text =
@@ -478,7 +478,7 @@ describe('ol.format.KML', function() {
it('can write XYZ LineString geometries', function() {
var layout = 'XYZ';
var lineString = new _ol_geom_LineString_(
var lineString = new LineString(
[[1, 2, 3], [4, 5, 6]], layout);
var features = [new _ol_Feature_(lineString)];
var node = format.writeFeaturesNode(features);
@@ -499,7 +499,7 @@ describe('ol.format.KML', function() {
it('can write XYM LineString geometries', function() {
var layout = 'XYM';
var lineString = new _ol_geom_LineString_(
var lineString = new LineString(
[[1, 2, 100], [3, 4, 200]], layout);
var features = [new _ol_Feature_(lineString)];
var node = format.writeFeaturesNode(features);
@@ -520,7 +520,7 @@ describe('ol.format.KML', function() {
it('can write XYZM LineString geometries', function() {
var layout = 'XYZM';
var lineString = new _ol_geom_LineString_(
var lineString = new LineString(
[[1, 2, 3, 100], [4, 5, 6, 200]], layout);
var features = [new _ol_Feature_(lineString)];
var node = format.writeFeaturesNode(features);
@@ -1181,7 +1181,7 @@ describe('ol.format.KML', function() {
var gs = g.getGeometries();
expect(gs).to.have.length(4);
expect(gs[0]).to.be.an(Point);
expect(gs[1]).to.be.an(_ol_geom_LineString_);
expect(gs[1]).to.be.an(LineString);
expect(gs[2]).to.be.an(_ol_geom_Polygon_);
expect(gs[3]).to.be.an(_ol_geom_Polygon_);
});
@@ -1210,7 +1210,7 @@ describe('ol.format.KML', function() {
it('can write GeometryCollection geometries', function() {
var collection = new _ol_geom_GeometryCollection_([
new Point([1, 2]),
new _ol_geom_LineString_([[1, 2], [3, 4]]),
new LineString([[1, 2], [3, 4]]),
new _ol_geom_Polygon_([[[1, 2], [3, 4], [3, 2], [1, 2]]])
]);
var features = [new _ol_Feature_(collection)];
@@ -1262,7 +1262,7 @@ describe('ol.format.KML', function() {
var f = fs[0];
expect(f).to.be.an(_ol_Feature_);
var g = f.getGeometry();
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
});
it('can read gx:MultiTrack', function() {
@@ -1292,7 +1292,7 @@ describe('ol.format.KML', function() {
expect(g).to.be.an(_ol_geom_MultiLineString_);
var gs = g.getLineStrings();
expect(gs).to.have.length(2);
expect(gs[0]).to.be.an(_ol_geom_LineString_);
expect(gs[0]).to.be.an(LineString);
});
it('can read dateTime', function() {

View File

@@ -1,7 +1,7 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_format_OSMXML_ from '../../../../src/ol/format/OSMXML.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import {get as getProjection, transform} from '../../../../src/ol/proj.js';
@@ -81,7 +81,7 @@ describe('ol.format.OSMXML', function() {
var line = fs[2];
expect(line).to.be.an(_ol_Feature_);
g = line.getGeometry();
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
expect(g.getCoordinates()).to.eql([[2, 1], [4, 3]]);
});
@@ -107,7 +107,7 @@ describe('ol.format.OSMXML', function() {
var line = fs[2];
expect(line).to.be.an(_ol_Feature_);
var g = line.getGeometry();
expect(g).to.be.an(_ol_geom_LineString_);
expect(g).to.be.an(LineString);
expect(g.getCoordinates()).to.eql([[2, 1], [4, 3]]);
});

View File

@@ -1,6 +1,6 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_format_Polyline_ from '../../../../src/ol/format/Polyline.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import {get as getProjection, transform} from '../../../../src/ol/proj.js';
describe('ol.format.Polyline', function() {
@@ -267,7 +267,7 @@ describe('ol.format.Polyline', function() {
var feature = format.readFeature(encodedFlatPoints);
expect(feature).to.be.an(_ol_Feature_);
var geometry = feature.getGeometry();
expect(geometry).to.be.an(_ol_geom_LineString_);
expect(geometry).to.be.an(LineString);
expect(geometry.getFlatCoordinates()).to.eql(flatPoints);
});
@@ -277,7 +277,7 @@ describe('ol.format.Polyline', function() {
});
expect(feature).to.be.an(_ol_Feature_);
var geometry = feature.getGeometry();
expect(geometry).to.be.an(_ol_geom_LineString_);
expect(geometry).to.be.an(LineString);
expect(geometry.getCoordinates()).to.eql(points3857);
});
@@ -292,7 +292,7 @@ describe('ol.format.Polyline', function() {
var feature = features[0];
expect(feature).to.be.an(_ol_Feature_);
var geometry = feature.getGeometry();
expect(geometry).to.be.an(_ol_geom_LineString_);
expect(geometry).to.be.an(LineString);
expect(geometry.getFlatCoordinates()).to.eql(flatPoints);
});
@@ -305,7 +305,7 @@ describe('ol.format.Polyline', function() {
var feature = features[0];
expect(feature).to.be.an(_ol_Feature_);
var geometry = feature.getGeometry();
expect(geometry).to.be.an(_ol_geom_LineString_);
expect(geometry).to.be.an(LineString);
expect(geometry.getCoordinates()).to.eql(points3857);
});
@@ -315,7 +315,7 @@ describe('ol.format.Polyline', function() {
it('returns the expected geometry', function() {
var geometry = format.readGeometry(encodedFlatPoints);
expect(geometry).to.be.an(_ol_geom_LineString_);
expect(geometry).to.be.an(LineString);
expect(geometry.getFlatCoordinates()).to.eql(flatPoints);
});
@@ -342,7 +342,7 @@ describe('ol.format.Polyline', function() {
var geometry = format.readGeometry(encodedFlatPoints, {
featureProjection: 'EPSG:3857'
});
expect(geometry).to.be.an(_ol_geom_LineString_);
expect(geometry).to.be.an(LineString);
expect(geometry.getCoordinates()).to.eql(points3857);
});
@@ -360,12 +360,12 @@ describe('ol.format.Polyline', function() {
describe('#writeFeature', function() {
it('returns the expected text', function() {
var feature = new _ol_Feature_(new _ol_geom_LineString_(points));
var feature = new _ol_Feature_(new LineString(points));
expect(format.writeFeature(feature)).to.be(encodedFlatPoints);
});
it('transforms and returns the expected text', function() {
var feature = new _ol_Feature_(new _ol_geom_LineString_(points3857));
var feature = new _ol_Feature_(new LineString(points3857));
expect(format.writeFeature(feature, {
featureProjection: 'EPSG:3857'
})).to.be(encodedFlatPoints);
@@ -376,12 +376,12 @@ describe('ol.format.Polyline', function() {
describe('#writeFeature', function() {
it('returns the expected text', function() {
var features = [new _ol_Feature_(new _ol_geom_LineString_(points))];
var features = [new _ol_Feature_(new LineString(points))];
expect(format.writeFeatures(features)).to.be(encodedFlatPoints);
});
it('transforms and returns the expected text', function() {
var features = [new _ol_Feature_(new _ol_geom_LineString_(points3857))];
var features = [new _ol_Feature_(new LineString(points3857))];
expect(format.writeFeatures(features, {
featureProjection: 'EPSG:3857'
})).to.be(encodedFlatPoints);
@@ -392,12 +392,12 @@ describe('ol.format.Polyline', function() {
describe('#writeGeometry', function() {
it('returns the expected text', function() {
var geometry = new _ol_geom_LineString_(points);
var geometry = new LineString(points);
expect(format.writeGeometry(geometry)).to.be(encodedFlatPoints);
});
it('transforms and returns the expected text', function() {
var geometry = new _ol_geom_LineString_(points3857);
var geometry = new LineString(points3857);
expect(format.writeGeometry(geometry, {
featureProjection: 'EPSG:3857'
})).to.be(encodedFlatPoints);

View File

@@ -2,7 +2,7 @@ import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_format_GML2_ from '../../../../src/ol/format/GML2.js';
import _ol_format_WFS_ from '../../../../src/ol/format/WFS.js';
import _ol_format_filter_ from '../../../../src/ol/format/filter.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
@@ -934,14 +934,14 @@ describe('ol.format.WFS', function() {
it('handles the WFS version', function() {
var format = new _ol_format_WFS_();
var insertFeature = new _ol_Feature_({
the_geom: new _ol_geom_LineString_([[1.1, 2], [3, 4.2]]),
the_geom: new LineString([[1.1, 2], [3, 4.2]]),
foo: 'bar',
nul: null
});
insertFeature.setGeometryName('the_geom');
var inserts = [insertFeature];
var updateFeature = new _ol_Feature_({
the_geom: new _ol_geom_LineString_([[1.1, 2], [3, 4.2]]),
the_geom: new LineString([[1.1, 2], [3, 4.2]]),
foo: 'bar',
// null value gets Property element with no Value
nul: null,
@@ -1021,14 +1021,14 @@ describe('ol.format.WFS', function() {
it('handles 3D in WFS 1.0.0', function() {
var format = new _ol_format_WFS_();
var insertFeature = new _ol_Feature_({
the_geom: new _ol_geom_LineString_([[1.1, 2, 4], [3, 4.2, 5]]),
the_geom: new LineString([[1.1, 2, 4], [3, 4.2, 5]]),
foo: 'bar',
nul: null
});
insertFeature.setGeometryName('the_geom');
var inserts = [insertFeature];
var updateFeature = new _ol_Feature_({
the_geom: new _ol_geom_LineString_([[1.1, 2, 6], [3, 4.2, 7]]),
the_geom: new LineString([[1.1, 2, 6], [3, 4.2, 7]]),
foo: 'bar',
// null value gets Property element with no Value
nul: null,

View File

@@ -1,6 +1,6 @@
import _ol_geom_Geometry_ from '../../../../src/ol/geom/Geometry.js';
import _ol_geom_GeometryCollection_ from '../../../../src/ol/geom/GeometryCollection.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
@@ -15,7 +15,7 @@ describe('ol.geom.GeometryCollection', function() {
var line, multi, point, poly;
beforeEach(function() {
point = new Point([10, 20]);
line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
line = new LineString([[10, 20], [30, 40]]);
poly = new _ol_geom_Polygon_([outer, inner1, inner2]);
multi = new _ol_geom_GeometryCollection_([point, line, poly]);
});
@@ -57,7 +57,7 @@ describe('ol.geom.GeometryCollection', function() {
it('returns a collection of geometries', function() {
var point = new Point([10, 20]);
var line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
var line = new LineString([[10, 20], [30, 40]]);
var poly = new _ol_geom_Polygon_([outer, inner1, inner2]);
var multi = new _ol_geom_GeometryCollection_([point, line, poly]);
@@ -65,7 +65,7 @@ describe('ol.geom.GeometryCollection', function() {
expect(geometries).to.be.an(Array);
expect(geometries).to.have.length(3);
expect(geometries[0]).to.be.a(Point);
expect(geometries[1]).to.be.a(_ol_geom_LineString_);
expect(geometries[1]).to.be.a(LineString);
expect(geometries[2]).to.be.a(_ol_geom_Polygon_);
});
@@ -75,7 +75,7 @@ describe('ol.geom.GeometryCollection', function() {
it('has a working clone method', function() {
var point = new Point([10, 20]);
var line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
var line = new LineString([[10, 20], [30, 40]]);
var poly = new _ol_geom_Polygon_([outer, inner1, inner2]);
var multi = new _ol_geom_GeometryCollection_([point, line, poly]);
var clone = multi.clone();
@@ -106,7 +106,7 @@ describe('ol.geom.GeometryCollection', function() {
it('returns the bounding extent', function() {
var point = new Point([10, 2]);
var line = new _ol_geom_LineString_([[1, 20], [30, 40]]);
var line = new LineString([[1, 20], [30, 40]]);
var multi = new _ol_geom_GeometryCollection_([point, line]);
var extent = multi.getExtent();
expect(extent[0]).to.be(1);
@@ -123,7 +123,7 @@ describe('ol.geom.GeometryCollection', function() {
beforeEach(function() {
point = new Point([5, 20]);
line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
line = new LineString([[10, 20], [30, 40]]);
poly = new _ol_geom_Polygon_([outer, inner1, inner2]);
multi = new _ol_geom_GeometryCollection_([point, line, poly]);
});
@@ -152,7 +152,7 @@ describe('ol.geom.GeometryCollection', function() {
var line, multi, point, poly;
beforeEach(function() {
point = new Point([10, 20]);
line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
line = new LineString([[10, 20], [30, 40]]);
poly = new _ol_geom_Polygon_([outer, inner1, inner2]);
multi = new _ol_geom_GeometryCollection_([point, line, poly]);
});
@@ -177,7 +177,7 @@ describe('ol.geom.GeometryCollection', function() {
it('scales a collection', function() {
var geom = new _ol_geom_GeometryCollection_([
new Point([-1, -2]),
new _ol_geom_LineString_([[0, 0], [1, 2]])
new LineString([[0, 0], [1, 2]])
]);
geom.scale(10);
var geometries = geom.getGeometries();
@@ -188,7 +188,7 @@ describe('ol.geom.GeometryCollection', function() {
it('accepts sx and sy', function() {
var geom = new _ol_geom_GeometryCollection_([
new Point([-1, -2]),
new _ol_geom_LineString_([[0, 0], [1, 2]])
new LineString([[0, 0], [1, 2]])
]);
geom.scale(2, 3);
var geometries = geom.getGeometries();
@@ -199,7 +199,7 @@ describe('ol.geom.GeometryCollection', function() {
it('accepts an anchor', function() {
var geom = new _ol_geom_GeometryCollection_([
new Point([-1, -2]),
new _ol_geom_LineString_([[0, 0], [1, 2]])
new LineString([[0, 0], [1, 2]])
]);
geom.scale(10, 15, [-1, -2]);
var geometries = geom.getGeometries();
@@ -214,7 +214,7 @@ describe('ol.geom.GeometryCollection', function() {
var line, multi, point;
beforeEach(function() {
point = new Point([10, 20]);
line = new _ol_geom_LineString_([[10, 20], [30, 40]]);
line = new LineString([[10, 20], [30, 40]]);
multi = new _ol_geom_GeometryCollection_([point, line]);
});
@@ -223,7 +223,7 @@ describe('ol.geom.GeometryCollection', function() {
var geometries = multi.getGeometries();
expect(geometries[0]).to.be.a(Point);
expect(geometries[1]).to.be.a(_ol_geom_LineString_);
expect(geometries[1]).to.be.a(LineString);
var coords = geometries[0].getCoordinates();
expect(coords[0]).to.roughlyEqual(1113194.90, 1e-2);

View File

@@ -1,12 +1,12 @@
import * as _ol_extent_ from '../../../../src/ol/extent.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
describe('ol.geom.LineString', function() {
it('can be constructed with a null geometry', function() {
expect(function() {
return new _ol_geom_LineString_(null);
return new LineString(null);
}).not.to.throwException();
});
@@ -14,7 +14,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new _ol_geom_LineString_([]);
lineString = new LineString([]);
});
it('defaults to layout XY', function() {
@@ -50,7 +50,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new _ol_geom_LineString_([[1, 2], [3, 4]]);
lineString = new LineString([[1, 2], [3, 4]]);
});
it('has the expected layout', function() {
@@ -111,7 +111,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new _ol_geom_LineString_([[1, 2, 3], [4, 5, 6]]);
lineString = new LineString([[1, 2, 3], [4, 5, 6]]);
});
it('has the expected layout', function() {
@@ -156,7 +156,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new _ol_geom_LineString_(
lineString = new LineString(
[[1, 2, 3], [4, 5, 6]], 'XYM');
});
@@ -202,7 +202,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new _ol_geom_LineString_([[1, 2, 3, 4], [5, 6, 7, 8]]);
lineString = new LineString([[1, 2, 3, 4], [5, 6, 7, 8]]);
});
it('has the expected layout', function() {
@@ -246,21 +246,21 @@ describe('ol.geom.LineString', function() {
describe('#scale()', function() {
it('scales a linestring', function() {
var geom = new _ol_geom_LineString_([[-10, -20], [10, 20]]);
var geom = new LineString([[-10, -20], [10, 20]]);
geom.scale(10);
var coordinates = geom.getCoordinates();
expect(coordinates).to.eql([[-100, -200], [100, 200]]);
});
it('accepts sx and sy', function() {
var geom = new _ol_geom_LineString_([[-10, -20], [10, 20]]);
var geom = new LineString([[-10, -20], [10, 20]]);
geom.scale(2, 3);
var coordinates = geom.getCoordinates();
expect(coordinates).to.eql([[-20, -60], [20, 60]]);
});
it('accepts an anchor', function() {
var geom = new _ol_geom_LineString_([[-10, -20], [10, 20]]);
var geom = new LineString([[-10, -20], [10, 20]]);
geom.scale(3, 2, [10, 20]);
var coordinates = geom.getCoordinates();
expect(coordinates).to.eql([[-50, -60], [10, 20]]);
@@ -272,7 +272,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new _ol_geom_LineString_(
lineString = new LineString(
[[0, 0], [1.5, 1], [3, 3], [5, 1], [6, 3.5], [7, 5]]);
});
@@ -308,7 +308,7 @@ describe('ol.geom.LineString', function() {
it('returns a simplified geometry', function() {
var simplified = lineString.simplify(1);
expect(simplified).to.be.an(_ol_geom_LineString_);
expect(simplified).to.be.an(LineString);
expect(simplified.getCoordinates()).to.eql(
[[0, 0], [3, 3], [5, 1], [7, 5]]);
});
@@ -331,7 +331,7 @@ describe('ol.geom.LineString', function() {
it('returns the expectedResult', function() {
var simplifiedGeometry = lineString.getSimplifiedGeometry(1);
expect(simplifiedGeometry).to.be.an(_ol_geom_LineString_);
expect(simplifiedGeometry).to.be.an(LineString);
expect(simplifiedGeometry.getCoordinates()).to.eql(
[[0, 0], [3, 3], [5, 1], [7, 5]]);
});
@@ -384,7 +384,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new _ol_geom_LineString_(
lineString = new LineString(
[[1, 2, 3], [4, 5, 6]], 'XYM');
});
@@ -413,7 +413,7 @@ describe('ol.geom.LineString', function() {
var lineString;
beforeEach(function() {
lineString = new _ol_geom_LineString_([
lineString = new LineString([
[0, 0, 0, 0],
[1, -1, 2, 1],
[2, -2, 4, 2],

View File

@@ -1,5 +1,5 @@
import * as _ol_extent_ from '../../../../src/ol/extent.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
@@ -40,11 +40,11 @@ describe('ol.geom.MultiLineString', function() {
it('can append line strings', function() {
multiLineString.appendLineString(
new _ol_geom_LineString_([[1, 2], [3, 4]]));
new LineString([[1, 2], [3, 4]]));
expect(multiLineString.getCoordinates()).to.eql(
[[[1, 2], [3, 4]]]);
multiLineString.appendLineString(
new _ol_geom_LineString_([[5, 6], [7, 8]]));
new LineString([[5, 6], [7, 8]]));
expect(multiLineString.getCoordinates()).to.eql(
[[[1, 2], [3, 4]], [[5, 6], [7, 8]]]);
});
@@ -168,11 +168,11 @@ describe('ol.geom.MultiLineString', function() {
it('can return individual line strings', function() {
var lineString0 = multiLineString.getLineString(0);
expect(lineString0).to.be.an(_ol_geom_LineString_);
expect(lineString0).to.be.an(LineString);
expect(lineString0.getLayout()).to.be('XYM');
expect(lineString0.getCoordinates()).to.eql([[1, 2, 3], [4, 5, 6]]);
var lineString1 = multiLineString.getLineString(1);
expect(lineString1).to.be.an(_ol_geom_LineString_);
expect(lineString1).to.be.an(LineString);
expect(lineString1.getLayout()).to.be('XYM');
expect(lineString1.getCoordinates()).to.eql([[7, 8, 9], [10, 11, 12]]);
});
@@ -344,8 +344,8 @@ describe('ol.geom.MultiLineString', function() {
it('sets the line strings', function() {
var multiLineString = new _ol_geom_MultiLineString_(null);
var lineString1 = new _ol_geom_LineString_([[1, 2], [3, 4]]);
var lineString2 = new _ol_geom_LineString_([[5, 6], [7, 8]]);
var lineString1 = new LineString([[1, 2], [3, 4]]);
var lineString2 = new LineString([[5, 6], [7, 8]]);
multiLineString.setLineStrings([lineString1, lineString2]);
expect(multiLineString.getFlatCoordinates()).to.eql(
[1, 2, 3, 4, 5, 6, 7, 8]);

View File

@@ -6,7 +6,7 @@ import _ol_array_ from '../../../../src/ol/array.js';
import _ol_events_ from '../../../../src/ol/events.js';
import _ol_events_condition_ from '../../../../src/ol/events/condition.js';
import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
@@ -284,7 +284,7 @@ describe('ol.interaction.Draw', function() {
var features = source.getFeatures();
expect(features).to.have.length(1);
var geometry = features[0].getGeometry();
expect(geometry).to.be.a(_ol_geom_LineString_);
expect(geometry).to.be.a(LineString);
expect(geometry.getCoordinates()).to.eql([[10, -20], [30, -20]]);
});
@@ -326,7 +326,7 @@ describe('ol.interaction.Draw', function() {
var features = source.getFeatures();
expect(features).to.have.length(1);
var geometry = features[0].getGeometry();
expect(geometry).to.be.a(_ol_geom_LineString_);
expect(geometry).to.be.a(LineString);
expect(geometry.getCoordinates()).to.eql(
[[10, -20], [20, -30], [20, -40]]);
});
@@ -363,7 +363,7 @@ describe('ol.interaction.Draw', function() {
var features = source.getFeatures();
// expect(features).to.have.length(1);
var geometry = features[0].getGeometry();
expect(geometry).to.be.a(_ol_geom_LineString_);
expect(geometry).to.be.a(LineString);
expect(geometry.getCoordinates()).to.eql(
[[10, -20], [20, -30], [30, -40], [40, -50], [50, -60], [60, -70]]);
});
@@ -392,7 +392,7 @@ describe('ol.interaction.Draw', function() {
var features = source.getFeatures();
expect(features).to.have.length(1);
var geometry = features[0].getGeometry();
expect(geometry).to.be.a(_ol_geom_LineString_);
expect(geometry).to.be.a(LineString);
expect(geometry.getCoordinates()).to.eql([[10, -20], [30, -20]]);
});
@@ -1036,7 +1036,7 @@ describe('ol.interaction.Draw', function() {
});
map.addInteraction(draw);
feature = new _ol_Feature_(
new _ol_geom_LineString_([[0, 0], [1, 1], [2, 0]]));
new LineString([[0, 0], [1, 1], [2, 0]]));
});
it('sets the initial state', function() {

View File

@@ -6,7 +6,7 @@ import _ol_View_ from '../../../../src/ol/View.js';
import _ol_events_ from '../../../../src/ol/events.js';
import _ol_events_condition_ from '../../../../src/ol/events/condition.js';
import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
import _ol_interaction_Modify_ from '../../../../src/ol/interaction/Modify.js';
@@ -226,7 +226,7 @@ describe('ol.interaction.Modify', function() {
it('deletes first vertex of a LineString', function() {
var lineFeature = new _ol_Feature_({
geometry: new _ol_geom_LineString_(
geometry: new LineString(
[[0, 0], [10, 20], [0, 40], [40, 40], [40, 0]]
)
});
@@ -262,7 +262,7 @@ describe('ol.interaction.Modify', function() {
it('deletes last vertex of a LineString', function() {
var lineFeature = new _ol_Feature_({
geometry: new _ol_geom_LineString_(
geometry: new LineString(
[[0, 0], [10, 20], [0, 40], [40, 40], [40, 0]]
)
});
@@ -298,7 +298,7 @@ describe('ol.interaction.Modify', function() {
it('deletes vertex of a LineString programmatically', function() {
var lineFeature = new _ol_Feature_({
geometry: new _ol_geom_LineString_(
geometry: new LineString(
[[0, 0], [10, 20], [0, 40], [40, 40], [40, 0]]
)
});
@@ -340,7 +340,7 @@ describe('ol.interaction.Modify', function() {
it('keeps the third dimension', function() {
var lineFeature = new _ol_Feature_({
geometry: new _ol_geom_LineString_(
geometry: new LineString(
[[0, 0, 10], [10, 20, 20], [0, 40, 30], [40, 40, 40], [40, 0, 50]]
)
});

View File

@@ -4,7 +4,7 @@ import _ol_Map_ from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_interaction_Snap_ from '../../../../src/ol/interaction/Snap.js';
@@ -73,7 +73,7 @@ describe('ol.interaction.Snap', function() {
});
it('snaps to edges only', function() {
var point = new _ol_Feature_(new _ol_geom_LineString_([[-10, 0], [10, 0]]));
var point = new _ol_Feature_(new LineString([[-10, 0], [10, 0]]));
var snapInteraction = new _ol_interaction_Snap_({
features: new _ol_Collection_([point]),
pixelTolerance: 5,
@@ -91,7 +91,7 @@ describe('ol.interaction.Snap', function() {
});
it('snaps to vertices only', function() {
var point = new _ol_Feature_(new _ol_geom_LineString_([[-10, 0], [10, 0]]));
var point = new _ol_Feature_(new LineString([[-10, 0], [10, 0]]));
var snapInteraction = new _ol_interaction_Snap_({
features: new _ol_Collection_([point]),
pixelTolerance: 5,
@@ -136,7 +136,7 @@ describe('ol.interaction.Snap', function() {
});
snapInteraction.setMap(map);
feature.setGeometry(new _ol_geom_LineString_([[-10, 0], [10, 0]]));
feature.setGeometry(new LineString([[-10, 0], [10, 0]]));
var event = {
pixel: [7 + width / 2, height / 2 - 4],
@@ -148,7 +148,7 @@ describe('ol.interaction.Snap', function() {
});
it('handle geometry changes', function() {
var line = new _ol_Feature_(new _ol_geom_LineString_([[-10, 0], [0, 0]]));
var line = new _ol_Feature_(new LineString([[-10, 0], [0, 0]]));
var snapInteraction = new _ol_interaction_Snap_({
features: new _ol_Collection_([line]),
pixelTolerance: 5,
@@ -169,8 +169,8 @@ describe('ol.interaction.Snap', function() {
it('handle geometry name changes', function() {
var line = new _ol_Feature_({
geometry: new _ol_geom_LineString_([[-10, 0], [0, 0]]),
alt_geometry: new _ol_geom_LineString_([[-10, 0], [10, 0]])
geometry: new LineString([[-10, 0], [0, 0]]),
alt_geometry: new LineString([[-10, 0], [10, 0]])
});
var snapInteraction = new _ol_interaction_Snap_({
features: new _ol_Collection_([line]),

View File

@@ -1,6 +1,6 @@
import _ol_geom_Circle_ from '../../../../../src/ol/geom/Circle.js';
import _ol_geom_GeometryCollection_ from '../../../../../src/ol/geom/GeometryCollection.js';
import _ol_geom_LineString_ from '../../../../../src/ol/geom/LineString.js';
import LineString from '../../../../../src/ol/geom/LineString.js';
import _ol_geom_MultiLineString_ from '../../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../../src/ol/geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.js';
@@ -81,7 +81,7 @@ describe('ol.render.canvas.Immediate', function() {
var context = new _ol_render_canvas_Immediate_(getMockContext(), 1, extent);
sinon.spy(context, 'drawLineString');
var geometry = new _ol_geom_LineString_([[1, 2], [3, 4]]);
var geometry = new LineString([[1, 2], [3, 4]]);
context.drawGeometry(geometry);
expect(context.drawLineString.calledOnce).to.be(true);
expect(context.drawLineString.firstCall.calledWithExactly(geometry)).to.be(true);
@@ -135,7 +135,7 @@ describe('ol.render.canvas.Immediate', function() {
sinon.spy(context, 'drawPolygon');
var point = new Point([1, 2]);
var linestring = new _ol_geom_LineString_([[1, 2], [3, 4]]);
var linestring = new LineString([[1, 2], [3, 4]]);
var polygon = new _ol_geom_Polygon_([[[1, 2], [3, 4], [5, 6], [1, 2]]]);
var geometry = new _ol_geom_GeometryCollection_([point, linestring, polygon]);

View File

@@ -1,4 +1,4 @@
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
@@ -78,7 +78,7 @@ describe('ol.render.Feature', function() {
describe('#getFlatMidpoint()', function() {
it('returns correct point', function() {
var line = new _ol_geom_LineString_([[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]);
var line = new LineString([[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]);
var feature = new _ol_render_Feature_('LineString', line.getFlatCoordinates());
expect(feature.getFlatMidpoint()).to.eql([10, 10]);
expect(feature.getFlatMidpoint()).to.eql(feature.flatMidpoints_);

View File

@@ -1,7 +1,7 @@
import _ol_Feature_ from '../../../../../src/ol/Feature.js';
import _ol_geom_Circle_ from '../../../../../src/ol/geom/Circle.js';
import _ol_geom_GeometryCollection_ from '../../../../../src/ol/geom/GeometryCollection.js';
import _ol_geom_LineString_ from '../../../../../src/ol/geom/LineString.js';
import LineString from '../../../../../src/ol/geom/LineString.js';
import _ol_geom_MultiLineString_ from '../../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../../src/ol/geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.js';
@@ -27,7 +27,7 @@ describe('ol.render.webgl.Immediate', function() {
stroke: new _ol_style_Stroke_()
});
circle = new _ol_geom_Circle_([0, 0], 5);
line = new _ol_geom_LineString_([[0, 0], [5, 5]]);
line = new LineString([[0, 0], [5, 5]]);
multiLine = new _ol_geom_MultiLineString_([[[0, 0], [5, 5]]]);
point = new Point([0, 0]);
multiPoint = new MultiPoint([[0, 0]]);

View File

@@ -1,6 +1,6 @@
import {getUid} from '../../../../../src/ol/index.js';
import _ol_Feature_ from '../../../../../src/ol/Feature.js';
import _ol_geom_LineString_ from '../../../../../src/ol/geom/LineString.js';
import LineString from '../../../../../src/ol/geom/LineString.js';
import _ol_geom_MultiLineString_ from '../../../../../src/ol/geom/MultiLineString.js';
import _ol_render_webgl_LineStringReplay_ from '../../../../../src/ol/render/webgl/LineStringReplay.js';
import _ol_render_webgl_linestringreplay_defaultshader_ from '../../../../../src/ol/render/webgl/linestringreplay/defaultshader.js';
@@ -56,7 +56,7 @@ describe('ol.render.webgl.LineStringReplay', function() {
it('sets the buffer data', function() {
var linestring;
linestring = new _ol_geom_LineString_(
linestring = new LineString(
[[1000, 2000], [2000, 3000]]);
replay.setFillStrokeStyle(null, strokeStyle1);
replay.drawLineString(linestring, null);
@@ -66,7 +66,7 @@ describe('ol.render.webgl.LineStringReplay', function() {
expect(replay.startIndices).to.have.length(1);
expect(replay.startIndicesFeature).to.have.length(1);
linestring = new _ol_geom_LineString_(
linestring = new LineString(
[[1000, 3000], [2000, 4000], [3000, 3000]]);
replay.drawLineString(linestring, null);
expect(replay.vertices).to.have.length(140);
@@ -106,7 +106,7 @@ describe('ol.render.webgl.LineStringReplay', function() {
lineJoin: 'bevel'
});
linestring = new _ol_geom_LineString_(
linestring = new LineString(
[[1000, 3000], [2000, 4000], [3000, 3000]]);
var flatCoordinates = linestring.getFlatCoordinates();
replay.setFillStrokeStyle(null, stroke);
@@ -126,7 +126,7 @@ describe('ol.render.webgl.LineStringReplay', function() {
lineCap: 'butt'
});
linestring = new _ol_geom_LineString_(
linestring = new LineString(
[[1000, 3000], [2000, 4000], [3000, 3000]]);
var flatCoordinates = linestring.getFlatCoordinates();
replay.setFillStrokeStyle(null, stroke);
@@ -145,7 +145,7 @@ describe('ol.render.webgl.LineStringReplay', function() {
color: [0, 255, 0, 1]
});
linestring = new _ol_geom_LineString_(
linestring = new LineString(
[[1000, 3000], [2000, 4000], [3000, 3000]]);
var flatCoordinates = linestring.getFlatCoordinates();
replay.setFillStrokeStyle(null, stroke);
@@ -168,7 +168,7 @@ describe('ol.render.webgl.LineStringReplay', function() {
lineJoin: 'bevel'
});
linestring = new _ol_geom_LineString_(
linestring = new LineString(
[[1000, 3000], [2000, 2000], [3000, 3000]]);
var flatCoordinates = linestring.getFlatCoordinates();
replay.setFillStrokeStyle(null, stroke);
@@ -189,7 +189,7 @@ describe('ol.render.webgl.LineStringReplay', function() {
lineJoin: 'bevel'
});
linestring = new _ol_geom_LineString_(
linestring = new LineString(
[[1000, 3000], [2000, 4000], [3000, 3000], [1000, 3000]]);
var flatCoordinates = linestring.getFlatCoordinates();
replay.setFillStrokeStyle(null, stroke);
@@ -287,13 +287,13 @@ describe('ol.render.webgl.LineStringReplay', function() {
describe('#drawReplay', function() {
var gl, context;
var feature1 = new _ol_Feature_({
geometry: new _ol_geom_LineString_([[0, 0], [500, 500]])
geometry: new LineString([[0, 0], [500, 500]])
});
var feature2 = new _ol_Feature_({
geometry: new _ol_geom_LineString_([[0, 0], [500, 500]])
geometry: new LineString([[0, 0], [500, 500]])
});
var feature3 = new _ol_Feature_({
geometry: new _ol_geom_LineString_([[0, 0], [500, 500]])
geometry: new LineString([[0, 0], [500, 500]])
});
beforeEach(function() {
gl = {

View File

@@ -1,7 +1,7 @@
import {getUid} from '../../../../../src/ol/index.js';
import _ol_Feature_ from '../../../../../src/ol/Feature.js';
import _ol_geom_GeometryCollection_ from '../../../../../src/ol/geom/GeometryCollection.js';
import _ol_geom_LineString_ from '../../../../../src/ol/geom/LineString.js';
import LineString from '../../../../../src/ol/geom/LineString.js';
import _ol_geom_MultiLineString_ from '../../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../../src/ol/geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../../../../../src/ol/geom/MultiPolygon.js';
@@ -232,7 +232,7 @@ describe('ol.render.canvas.ReplayGroup', function() {
var point = new _ol_Feature_(new Point([45, 90]));
var multipoint = new _ol_Feature_(new MultiPoint(
[[45, 90], [90, 45]]));
var linestring = new _ol_Feature_(new _ol_geom_LineString_(
var linestring = new _ol_Feature_(new LineString(
[[45, 90], [45, 45], [90, 45]]));
var multilinestring = new _ol_Feature_(new _ol_geom_MultiLineString_(
[linestring.getGeometry().getCoordinates(), linestring.getGeometry().getCoordinates()]));

View File

@@ -1,6 +1,6 @@
import {nullFunction} from '../../../../src/ol/index.js';
import _ol_events_ from '../../../../src/ol/events.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
@@ -99,7 +99,7 @@ describe('ol.renderer.vector', function() {
});
it('does render the linestring', function() {
feature.setGeometry(new _ol_geom_LineString_([[0, 0], [1, 1]]));
feature.setGeometry(new LineString([[0, 0], [1, 1]]));
var lineStringReplay = replayGroup.getReplay(
style.getZIndex(), 'LineString');
var setFillStrokeStyleSpy = sinon.spy(lineStringReplay,

View File

@@ -1,5 +1,5 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
import {get as getProjection} from '../../../../src/ol/proj.js';
@@ -51,7 +51,7 @@ describe('ol.source.Cluster', function() {
source: new _ol_source_Vector_({
features: [
new _ol_Feature_(new Point([0, 0])),
new _ol_Feature_(new _ol_geom_LineString_([[0, 0], [1, 1]])),
new _ol_Feature_(new LineString([[0, 0], [1, 1]])),
new _ol_Feature_(new _ol_geom_Polygon_(
[[[-1, -1], [-1, 1], [1, 1], [1, -1], [-1, -1]]]))
]

View File

@@ -4,7 +4,7 @@ import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_Map_ from '../../../../src/ol/Map.js';
import _ol_View_ from '../../../../src/ol/View.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_layer_Vector_ from '../../../../src/ol/layer/Vector.js';
import _ol_loadingstrategy_ from '../../../../src/ol/loadingstrategy.js';
import {get as getProjection, transformExtent, fromLonLat} from '../../../../src/ol/proj.js';
@@ -92,7 +92,7 @@ describe('ol.source.Vector', function() {
var features = [];
var vectorSource;
beforeEach(function() {
features.push(new _ol_Feature_(new _ol_geom_LineString_([[0, 0], [10, 10]])));
features.push(new _ol_Feature_(new LineString([[0, 0], [10, 10]])));
features.push(new _ol_Feature_(new Point([0, 10])));
features.push(new _ol_Feature_(new Point([10, 5])));
vectorSource = new _ol_source_Vector_({

View File

@@ -5,7 +5,7 @@
import _ol_Sphere_ from '../../../src/ol/Sphere.js';
import _ol_format_WKT_ from '../../../src/ol/format/WKT.js';
import _ol_geom_GeometryCollection_ from '../../../src/ol/geom/GeometryCollection.js';
import _ol_geom_LineString_ from '../../../src/ol/geom/LineString.js';
import LineString from '../../../src/ol/geom/LineString.js';
import _ol_geom_MultiLineString_ from '../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../src/ol/geom/MultiPoint.js';
import Point from '../../../src/ol/geom/Point.js';
@@ -121,7 +121,7 @@ describe('ol.Sphere.getLength()', function() {
geometry: new MultiPoint([[0, 0], [1, 1]]),
length: 0
}, {
geometry: new _ol_geom_LineString_([
geometry: new LineString([
[12801741.441226462, -3763310.627144653],
[14582853.293918837, -2511525.2348457114],
[15918687.18343812, -2875744.624352243],
@@ -129,7 +129,7 @@ describe('ol.Sphere.getLength()', function() {
]),
length: 4407939.124914191
}, {
geometry: new _ol_geom_LineString_([
geometry: new LineString([
[115, -32],
[131, -22],
[143, -25],
@@ -155,13 +155,13 @@ describe('ol.Sphere.getLength()', function() {
length: 2 * 4407939.124914191
}, {
geometry: new _ol_geom_GeometryCollection_([
new _ol_geom_LineString_([
new LineString([
[115, -32],
[131, -22],
[143, -25],
[150, -34]
]),
new _ol_geom_LineString_([
new LineString([
[115, -32],
[131, -22],
[143, -25],

View File

@@ -3,7 +3,7 @@ import _ol_View_ from '../../../src/ol/View.js';
import _ol_ViewHint_ from '../../../src/ol/ViewHint.js';
import * as _ol_extent_ from '../../../src/ol/extent.js';
import _ol_geom_Circle_ from '../../../src/ol/geom/Circle.js';
import _ol_geom_LineString_ from '../../../src/ol/geom/LineString.js';
import LineString from '../../../src/ol/geom/LineString.js';
import Point from '../../../src/ol/geom/Point.js';
describe('ol.View', function() {
@@ -1252,21 +1252,21 @@ describe('ol.View', function() {
});
it('fits correctly to the geometry', function() {
view.fit(
new _ol_geom_LineString_([[6000, 46000], [6000, 47100], [7000, 46000]]),
new LineString([[6000, 46000], [6000, 47100], [7000, 46000]]),
{size: [200, 200], padding: [100, 0, 0, 100], constrainResolution: false});
expect(view.getResolution()).to.be(11);
expect(view.getCenter()[0]).to.be(5950);
expect(view.getCenter()[1]).to.be(47100);
view.fit(
new _ol_geom_LineString_([[6000, 46000], [6000, 47100], [7000, 46000]]),
new LineString([[6000, 46000], [6000, 47100], [7000, 46000]]),
{size: [200, 200], padding: [100, 0, 0, 100]});
expect(view.getResolution()).to.be(20);
expect(view.getCenter()[0]).to.be(5500);
expect(view.getCenter()[1]).to.be(47550);
view.fit(
new _ol_geom_LineString_([[6000, 46000], [6000, 47100], [7000, 46000]]),
new LineString([[6000, 46000], [6000, 47100], [7000, 46000]]),
{size: [200, 200], padding: [100, 0, 0, 100], nearest: true});
expect(view.getResolution()).to.be(10);
expect(view.getCenter()[0]).to.be(6000);
@@ -1304,7 +1304,7 @@ describe('ol.View', function() {
view.setRotation(Math.PI / 4);
view.fit(
new _ol_geom_LineString_([[6000, 46000], [6000, 47100], [7000, 46000]]),
new LineString([[6000, 46000], [6000, 47100], [7000, 46000]]),
{size: [200, 200], padding: [100, 0, 0, 100], constrainResolution: false});
expect(view.getResolution()).to.roughlyEqual(14.849242404917458, 1e-9);
expect(view.getCenter()[0]).to.roughlyEqual(5200, 1e-9);
@@ -1328,7 +1328,7 @@ describe('ol.View', function() {
});
it('animates when duration is defined', function(done) {
view.fit(
new _ol_geom_LineString_([[6000, 46000], [6000, 47100], [7000, 46000]]),
new LineString([[6000, 46000], [6000, 47100], [7000, 46000]]),
{
size: [200, 200],
padding: [100, 0, 0, 100],
@@ -1348,7 +1348,7 @@ describe('ol.View', function() {
});
it('calls a callback when duration is not defined', function(done) {
view.fit(new _ol_geom_LineString_([[6000, 46000], [6000, 47100], [7000, 46000]]), {
view.fit(new LineString([[6000, 46000], [6000, 47100], [7000, 46000]]), {
callback: function(complete) {
expect(complete).to.be(true);
done();
@@ -1356,7 +1356,7 @@ describe('ol.View', function() {
});
});
it('calls a callback when animation completes', function(done) {
view.fit(new _ol_geom_LineString_([[6000, 46000], [6000, 47100], [7000, 46000]]), {
view.fit(new LineString([[6000, 46000], [6000, 47100], [7000, 46000]]), {
duration: 25,
callback: function(complete) {
expect(complete).to.be(true);