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
+14 -14
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);
+16 -16
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
+9 -9
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() {
+4 -4
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]);
+11 -11
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() {
+3 -3
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]]);
});
+13 -13
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);
+5 -5
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,