Rename _ol_geom_Point_ to Point

This commit is contained in:
Tim Schaub
2017-12-14 08:49:10 -07:00
parent 75c5a8b246
commit eadec38ae2
76 changed files with 365 additions and 365 deletions

View File

@@ -6,7 +6,7 @@ import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
import _ol_geom_MultiPoint_ from '../../../../src/ol/geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
import {get as getProjection, transform} from '../../../../src/ol/proj.js';
@@ -163,7 +163,7 @@ describe('ol.format.EsriJSON', function() {
var feature = format.readFeature(pointEsriJSON);
expect(feature).to.be.an(_ol_Feature_);
var geometry = feature.getGeometry();
expect(geometry).to.be.an(_ol_geom_Point_);
expect(geometry).to.be.an(Point);
expect(geometry.getCoordinates()).to.eql([102.0, 0.5]);
expect(feature.get('prop0')).to.be('value0');
});
@@ -227,7 +227,7 @@ describe('ol.format.EsriJSON', function() {
it('can read a feature collection', function() {
var features = format.readFeatures(featureCollectionEsriJSON);
expect(features).to.have.length(3);
expect(features[0].getGeometry()).to.be.an(_ol_geom_Point_);
expect(features[0].getGeometry()).to.be.an(Point);
expect(features[1].getGeometry()).to.be.an(_ol_geom_LineString_);
expect(features[2].getGeometry()).to.be.an(_ol_geom_Polygon_);
});
@@ -237,7 +237,7 @@ describe('ol.format.EsriJSON', function() {
featureProjection: 'EPSG:3857',
dataProjection: 'EPSG:4326'
});
expect(feature[0].getGeometry()).to.be.an(_ol_geom_Point_);
expect(feature[0].getGeometry()).to.be.an(Point);
expect(feature[0].getGeometry().getCoordinates()).to.eql(
transform([102.0, 0.5], 'EPSG:4326', 'EPSG:3857'));
});
@@ -247,7 +247,7 @@ describe('ol.format.EsriJSON', function() {
featureProjection: 'EPSG:3857',
dataProjection: 'EPSG:4326'
});
expect(features[0].getGeometry()).to.be.an(_ol_geom_Point_);
expect(features[0].getGeometry()).to.be.an(Point);
expect(features[0].getGeometry().getCoordinates()).to.eql(
transform([102.0, 0.5], 'EPSG:4326', 'EPSG:3857'));
expect(features[1].getGeometry().getCoordinates()).to.eql([
@@ -268,7 +268,7 @@ describe('ol.format.EsriJSON', function() {
var feature = new _ol_format_EsriJSON_({geometryName: 'the_geom'}).
readFeature(pointEsriJSON);
expect(feature.getGeometryName()).to.be('the_geom');
expect(feature.getGeometry()).to.be.an(_ol_geom_Point_);
expect(feature.getGeometry()).to.be.an(Point);
});
});
@@ -336,7 +336,7 @@ describe('ol.format.EsriJSON', function() {
});
var obj = format.readGeometry(str);
expect(obj).to.be.a(_ol_geom_Point_);
expect(obj).to.be.a(Point);
expect(obj.getCoordinates()).to.eql([10, 20]);
expect(obj.getLayout()).to.eql('XY');
});
@@ -349,7 +349,7 @@ describe('ol.format.EsriJSON', function() {
});
var obj = format.readGeometry(str);
expect(obj).to.be.a(_ol_geom_Point_);
expect(obj).to.be.a(Point);
expect(obj.getCoordinates()).to.eql([10, 20, 10]);
expect(obj.getLayout()).to.eql('XYZ');
});
@@ -362,7 +362,7 @@ describe('ol.format.EsriJSON', function() {
});
var obj = format.readGeometry(str);
expect(obj).to.be.a(_ol_geom_Point_);
expect(obj).to.be.a(Point);
expect(obj.getCoordinates()).to.eql([10, 20, 10]);
expect(obj.getLayout()).to.eql('XYM');
});
@@ -376,7 +376,7 @@ describe('ol.format.EsriJSON', function() {
});
var obj = format.readGeometry(str);
expect(obj).to.be.a(_ol_geom_Point_);
expect(obj).to.be.a(Point);
expect(obj.getCoordinates()).to.eql([10, 20, 0, 10]);
expect(obj.getLayout()).to.eql('XYZM');
});
@@ -746,7 +746,7 @@ describe('ol.format.EsriJSON', function() {
var first = features[0];
expect(first).to.be.a(_ol_Feature_);
expect(first.get('foo')).to.be('bar');
expect(first.getGeometry()).to.be.a(_ol_geom_Point_);
expect(first.getGeometry()).to.be.a(Point);
var second = features[1];
expect(second).to.be.a(_ol_Feature_);
@@ -762,28 +762,28 @@ describe('ol.format.EsriJSON', function() {
describe('#writeGeometry', function() {
it('encodes point', function() {
var point = new _ol_geom_Point_([10, 20]);
var point = new Point([10, 20]);
var esrijson = format.writeGeometry(point);
expect(point.getCoordinates()).to.eql(
format.readGeometry(esrijson).getCoordinates());
});
it('encodes XYZ point', function() {
var point = new _ol_geom_Point_([10, 20, 0], 'XYZ');
var point = new Point([10, 20, 0], 'XYZ');
var esrijson = format.writeGeometry(point);
expect(point.getCoordinates()).to.eql(
format.readGeometry(esrijson).getCoordinates());
});
it('encodes XYM point', function() {
var point = new _ol_geom_Point_([10, 20, 0], 'XYM');
var point = new Point([10, 20, 0], 'XYM');
var esrijson = format.writeGeometry(point);
expect(point.getCoordinates()).to.eql(
format.readGeometry(esrijson).getCoordinates());
});
it('encodes XYZM point', function() {
var point = new _ol_geom_Point_([10, 20, 5, 0],
var point = new Point([10, 20, 5, 0],
'XYZM');
var esrijson = format.writeGeometry(point);
expect(point.getCoordinates()).to.eql(
@@ -989,7 +989,7 @@ describe('ol.format.EsriJSON', function() {
});
it('transforms and encodes a point', function() {
var point = new _ol_geom_Point_([2, 3]);
var point = new Point([2, 3]);
var esrijson = format.writeGeometry(point, {
dataProjection: 'EPSG:4326',
featureProjection: 'EPSG:3857'
@@ -1050,13 +1050,13 @@ describe('ol.format.EsriJSON', function() {
function() {
var feature = new _ol_Feature_({'foo': 'bar'});
feature.setGeometryName('mygeom');
feature.setGeometry(new _ol_geom_Point_([5, 10]));
feature.setGeometry(new Point([5, 10]));
var esrijson = format.writeFeaturesObject([feature]);
expect(esrijson.features[0].attributes.mygeom).to.eql(undefined);
});
it('writes out a feature without properties correctly', function() {
var feature = new _ol_Feature_(new _ol_geom_Point_([5, 10]));
var feature = new _ol_Feature_(new Point([5, 10]));
var esrijson = format.writeFeatureObject(feature);
expect(esrijson.attributes).to.eql({});
});

View File

@@ -6,7 +6,7 @@ import _ol_geom_GeometryCollection_ from '../../../../src/ol/geom/GeometryCollec
import _ol_geom_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 _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
import {fromLonLat, get as getProjection, toLonLat, transform} from '../../../../src/ol/proj.js';
@@ -147,7 +147,7 @@ describe('ol.format.GeoJSON', function() {
var feature = format.readFeature(pointGeoJSON);
expect(feature).to.be.an(_ol_Feature_);
var geometry = feature.getGeometry();
expect(geometry).to.be.an(_ol_geom_Point_);
expect(geometry).to.be.an(Point);
expect(geometry.getCoordinates()).to.eql([102.0, 0.5]);
expect(feature.get('prop0')).to.be('value0');
});
@@ -156,7 +156,7 @@ describe('ol.format.GeoJSON', function() {
var feature = format.readFeature(pointGeoJSON.geometry);
expect(feature).to.be.an(_ol_Feature_);
var geometry = feature.getGeometry();
expect(geometry).to.be.an(_ol_geom_Point_);
expect(geometry).to.be.an(Point);
expect(geometry.getCoordinates()).to.eql([102.0, 0.5]);
});
@@ -200,7 +200,7 @@ describe('ol.format.GeoJSON', function() {
it('can read a feature collection', function() {
var features = format.readFeatures(featureCollectionGeoJSON);
expect(features).to.have.length(3);
expect(features[0].getGeometry()).to.be.an(_ol_geom_Point_);
expect(features[0].getGeometry()).to.be.an(Point);
expect(features[1].getGeometry()).to.be.an(_ol_geom_LineString_);
expect(features[2].getGeometry()).to.be.an(_ol_geom_Polygon_);
});
@@ -209,7 +209,7 @@ describe('ol.format.GeoJSON', function() {
var feature = format.readFeatures(pointGeoJSON, {
featureProjection: 'EPSG:3857'
});
expect(feature[0].getGeometry()).to.be.an(_ol_geom_Point_);
expect(feature[0].getGeometry()).to.be.an(Point);
expect(feature[0].getGeometry().getCoordinates()).to.eql(
transform([102.0, 0.5], 'EPSG:4326', 'EPSG:3857'));
});
@@ -217,7 +217,7 @@ describe('ol.format.GeoJSON', function() {
it('uses featureProjection passed to the constructor', function() {
var format = new _ol_format_GeoJSON_({featureProjection: 'EPSG:3857'});
var feature = format.readFeatures(pointGeoJSON);
expect(feature[0].getGeometry()).to.be.an(_ol_geom_Point_);
expect(feature[0].getGeometry()).to.be.an(Point);
expect(feature[0].getGeometry().getCoordinates()).to.eql(
transform([102.0, 0.5], 'EPSG:4326', 'EPSG:3857'));
});
@@ -227,7 +227,7 @@ describe('ol.format.GeoJSON', function() {
var feature = format.readFeatures(pointGeoJSON, {
featureProjection: 'EPSG:3857'
});
expect(feature[0].getGeometry()).to.be.an(_ol_geom_Point_);
expect(feature[0].getGeometry()).to.be.an(Point);
expect(feature[0].getGeometry().getCoordinates()).to.eql(
transform([102.0, 0.5], 'EPSG:4326', 'EPSG:3857'));
});
@@ -236,7 +236,7 @@ describe('ol.format.GeoJSON', function() {
var features = format.readFeatures(featureCollectionGeoJSON, {
featureProjection: 'EPSG:3857'
});
expect(features[0].getGeometry()).to.be.an(_ol_geom_Point_);
expect(features[0].getGeometry()).to.be.an(Point);
expect(features[0].getGeometry().getCoordinates()).to.eql(
transform([102.0, 0.5], 'EPSG:4326', 'EPSG:3857'));
expect(features[1].getGeometry().getCoordinates()).to.eql([
@@ -257,7 +257,7 @@ describe('ol.format.GeoJSON', function() {
var feature = new _ol_format_GeoJSON_({geometryName: 'the_geom'}).
readFeature(pointGeoJSON);
expect(feature.getGeometryName()).to.be('the_geom');
expect(feature.getGeometry()).to.be.an(_ol_geom_Point_);
expect(feature.getGeometry()).to.be.an(Point);
});
});
@@ -356,7 +356,7 @@ describe('ol.format.GeoJSON', function() {
});
var obj = format.readGeometry(str);
expect(obj).to.be.a(_ol_geom_Point_);
expect(obj).to.be.a(Point);
expect(obj.getCoordinates()).to.eql([10, 20]);
expect(obj.getLayout()).to.eql('XY');
});
@@ -417,7 +417,7 @@ describe('ol.format.GeoJSON', function() {
expect(geometryCollection).to.be.an(_ol_geom_GeometryCollection_);
var array = geometryCollection.getGeometries();
expect(array.length).to.be(2);
expect(array[0]).to.be.a(_ol_geom_Point_);
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].getLayout()).to.eql('XY');
@@ -464,7 +464,7 @@ describe('ol.format.GeoJSON', function() {
var first = features[0];
expect(first).to.be.a(_ol_Feature_);
expect(first.get('foo')).to.be('bar');
expect(first.getGeometry()).to.be.a(_ol_geom_Point_);
expect(first.getGeometry()).to.be.a(Point);
var second = features[1];
expect(second).to.be.a(_ol_Feature_);
@@ -507,7 +507,7 @@ describe('ol.format.GeoJSON', function() {
var first = features[0];
expect(first).to.be.a(_ol_Feature_);
expect(first.get('foo')).to.be('bar');
expect(first.getGeometry()).to.be.a(_ol_geom_Point_);
expect(first.getGeometry()).to.be.a(Point);
var second = features[1];
expect(second).to.be.a(_ol_Feature_);
@@ -562,13 +562,13 @@ describe('ol.format.GeoJSON', function() {
function() {
var feature = new _ol_Feature_({'foo': 'bar'});
feature.setGeometryName('mygeom');
feature.setGeometry(new _ol_geom_Point_([5, 10]));
feature.setGeometry(new Point([5, 10]));
var geojson = format.writeFeaturesObject([feature]);
expect(geojson.features[0].properties.mygeom).to.eql(undefined);
});
it('writes out a feature without properties correctly', function() {
var feature = new _ol_Feature_(new _ol_geom_Point_([5, 10]));
var feature = new _ol_Feature_(new Point([5, 10]));
var geojson = format.writeFeatureObject(feature);
expect(geojson.properties).to.eql(null);
});
@@ -590,14 +590,14 @@ describe('ol.format.GeoJSON', function() {
describe('#writeGeometry', function() {
it('encodes point', function() {
var point = new _ol_geom_Point_([10, 20]);
var point = new Point([10, 20]);
var geojson = format.writeGeometry(point);
expect(point.getCoordinates()).to.eql(
format.readGeometry(geojson).getCoordinates());
});
it('accepts featureProjection', function() {
var point = new _ol_geom_Point_(fromLonLat([10, 20]));
var point = new Point(fromLonLat([10, 20]));
var geojson = format.writeGeometry(point, {featureProjection: 'EPSG:3857'});
var obj = JSON.parse(geojson);
expect(obj.coordinates).to.eql(toLonLat(point.getCoordinates()));
@@ -605,7 +605,7 @@ describe('ol.format.GeoJSON', function() {
it('respects featureProjection passed to constructor', function() {
var format = new _ol_format_GeoJSON_({featureProjection: 'EPSG:3857'});
var point = new _ol_geom_Point_(fromLonLat([10, 20]));
var point = new Point(fromLonLat([10, 20]));
var geojson = format.writeGeometry(point);
var obj = JSON.parse(geojson);
expect(obj.coordinates).to.eql(toLonLat(point.getCoordinates()));
@@ -730,7 +730,7 @@ describe('ol.format.GeoJSON', function() {
it('encodes geometry collection', function() {
var collection = new _ol_geom_GeometryCollection_([
new _ol_geom_Point_([10, 20]),
new Point([10, 20]),
new _ol_geom_LineString_([[30, 40], [50, 60]])
]);
var geojson = format.writeGeometry(collection);
@@ -756,7 +756,7 @@ describe('ol.format.GeoJSON', function() {
});
it('transforms and encodes a point', function() {
var point = new _ol_geom_Point_([2, 3]);
var point = new Point([2, 3]);
var geojson = format.writeGeometry(point, {
featureProjection: 'EPSG:3857'
});
@@ -771,7 +771,7 @@ describe('ol.format.GeoJSON', function() {
it('transforms and encodes geometry collection', function() {
var collection = new _ol_geom_GeometryCollection_([
new _ol_geom_Point_([2, 3]),
new Point([2, 3]),
new _ol_geom_LineString_([[3, 2], [2, 1]])
]);
var geojson = format.writeGeometry(collection, {
@@ -793,7 +793,7 @@ describe('ol.format.GeoJSON', function() {
});
it('truncates transformed point with decimals option', function() {
var point = new _ol_geom_Point_([2, 3]).transform('EPSG:4326', 'EPSG:3857');
var point = new Point([2, 3]).transform('EPSG:4326', 'EPSG:3857');
var geojson = format.writeGeometry(point, {
featureProjection: 'EPSG:3857',
decimals: 2

View File

@@ -6,7 +6,7 @@ import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
import _ol_geom_MultiPoint_ from '../../../../src/ol/geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
import {transform} from '../../../../src/ol/proj.js';
import _ol_xml_ from '../../../../src/ol/xml.js';
@@ -57,7 +57,7 @@ describe('ol.format.GML2', function() {
'</gml:Point>';
var g = readGeometry(format, text);
expect(g).to.be.an(_ol_geom_Point_);
expect(g).to.be.an(Point);
expect(g.getCoordinates()).to.eql([-180, -90, 0]);
});
@@ -68,7 +68,7 @@ describe('ol.format.GML2', function() {
'</gml:Point>';
var g = readGeometry(format, text);
expect(g).to.be.an(_ol_geom_Point_);
expect(g).to.be.an(Point);
expect(g.getCoordinates()).to.eql([-180, -90, 42]);
});
@@ -222,7 +222,7 @@ describe('ol.format.GML2', function() {
' </layer>';
var feature = new _ol_Feature_({
geometry: new _ol_geom_Point_([1.1, 2])
geometry: new Point([1.1, 2])
});
feature.setId(1);
var objectStack = [{
@@ -355,7 +355,7 @@ describe('ol.format.GML3', function() {
' <gml:pos srsDimension="2">1 2</gml:pos>' +
'</gml:Point>';
var g = readGeometry(format, text);
expect(g).to.be.an(_ol_geom_Point_);
expect(g).to.be.an(Point);
expect(g.getCoordinates()).to.eql([1, 2, 0]);
var serialized = format.writeGeometryNode(g);
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
@@ -368,7 +368,7 @@ describe('ol.format.GML3', function() {
' <gml:pos>1E7 2</gml:pos>' +
'</gml:Point>';
var g = readGeometry(format, text);
expect(g).to.be.an(_ol_geom_Point_);
expect(g).to.be.an(Point);
expect(g.getCoordinates()).to.eql([10000000, 2, 0]);
text =
'<gml:Point xmlns:gml="http://www.opengis.net/gml" ' +
@@ -376,7 +376,7 @@ describe('ol.format.GML3', function() {
' <gml:pos>1e7 2</gml:pos>' +
'</gml:Point>';
g = readGeometry(format, text);
expect(g).to.be.an(_ol_geom_Point_);
expect(g).to.be.an(Point);
expect(g.getCoordinates()).to.eql([10000000, 2, 0]);
});
@@ -390,7 +390,7 @@ describe('ol.format.GML3', function() {
' <gml:pos>1 2</gml:pos>' +
'</gml:Point>';
var g = readGeometry(format, text, config);
expect(g).to.be.an(_ol_geom_Point_);
expect(g).to.be.an(Point);
var coordinates = g.getCoordinates();
expect(coordinates.splice(0, 2)).to.eql(
transform([1, 2], 'CRS:84', 'EPSG:3857'));
@@ -412,7 +412,7 @@ describe('ol.format.GML3', function() {
' <gml:pos>1 2</gml:pos>' +
'</gml:Point>';
var g = readGeometry(formatNoSrs, text, config);
expect(g).to.be.an(_ol_geom_Point_);
expect(g).to.be.an(Point);
var coordinates = g.getCoordinates();
expect(coordinates.splice(0, 2)).to.eql(
transform([1, 2], 'CRS:84', 'EPSG:3857'));
@@ -425,7 +425,7 @@ describe('ol.format.GML3', function() {
' <gml:pos srsDimension="2">2 1</gml:pos>' +
'</gml:Point>';
var g = readGeometry(formatWGS84, text);
expect(g).to.be.an(_ol_geom_Point_);
expect(g).to.be.an(Point);
expect(g.getCoordinates()).to.eql([1, 2, 0]);
var serialized = formatWGS84.writeGeometryNode(g);
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
@@ -514,7 +514,7 @@ describe('ol.format.GML3', function() {
' <gml:pos srsDimension="2">-90 -180</gml:pos>' +
'</gml:Point>';
var g = readGeometry(format, text);
expect(g).to.be.an(_ol_geom_Point_);
expect(g).to.be.an(Point);
expect(g.getCoordinates()).to.eql([-180, -90, 0]);
var serialized = formatWGS84.writeGeometryNode(g);
expect(serialized.firstElementChild).to.xmleql(_ol_xml_.parse(text));
@@ -1333,7 +1333,7 @@ describe('ol.format.GML3', function() {
it('creates 2 geometries', function() {
var feature = features[0];
expect(feature.get('center')).to.be.a(_ol_geom_Point_);
expect(feature.get('center')).to.be.a(Point);
expect(feature.get('the_geom')).to.be.a(_ol_geom_MultiPolygon_);
});
@@ -1534,7 +1534,7 @@ describe('ol.format.GML3', function() {
it('creates a Point', function() {
feature = features[2];
expect(feature.getId()).to.equal('geoserver_layer.3');
expect(feature.getGeometry()).to.be.an(_ol_geom_Point_);
expect(feature.getGeometry()).to.be.an(Point);
});

View File

@@ -2,7 +2,7 @@ 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 _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
import {get as getProjection, transform} from '../../../../src/ol/proj.js';
import _ol_xml_ from '../../../../src/ol/xml.js';
@@ -393,7 +393,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_Point_);
expect(g).to.be.an(Point);
expect(g.getCoordinates()).to.eql([2, 1]);
expect(g.getLayout()).to.be('XY');
var serialized = format.writeFeaturesNode(fs);
@@ -415,7 +415,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_Point_);
expect(g).to.be.an(Point);
var expectedPoint = transform([2, 1], 'EPSG:4326', 'EPSG:3857');
expect(g.getCoordinates()).to.eql(expectedPoint);
expect(g.getLayout()).to.be('XY');
@@ -440,7 +440,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_Point_);
expect(g).to.be.an(Point);
expect(g.getCoordinates()).to.eql([2, 1, 3]);
expect(g.getLayout()).to.be('XYZ');
var serialized = format.writeFeaturesNode(fs);
@@ -462,7 +462,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_Point_);
expect(g).to.be.an(Point);
expect(g.getCoordinates()).to.eql([2, 1, 1263115752]);
expect(g.getLayout()).to.be('XYM');
var serialized = format.writeFeaturesNode(fs);
@@ -485,7 +485,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_Point_);
expect(g).to.be.an(Point);
expect(g.getCoordinates()).to.eql([2, 1, 3, 1263115752]);
expect(g.getLayout()).to.be('XYZM');
var serialized = format.writeFeaturesNode(fs);

View File

@@ -8,7 +8,7 @@ import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
import _ol_geom_MultiLineString_ from '../../../../src/ol/geom/MultiLineString.js';
import _ol_geom_MultiPoint_ from '../../../../src/ol/geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
import {addProjection, addCoordinateTransforms, transform, get as getProjection} from '../../../../src/ol/proj.js';
import _ol_proj_Projection_ from '../../../../src/ol/proj/Projection.js';
@@ -239,7 +239,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_Point_);
expect(g).to.be.an(Point);
expect(g.getCoordinates()).to.eql([1, 2, 3]);
expect(g.get('extrude')).to.be(false);
expect(g.get('altitudeMode')).to.be('absolute');
@@ -265,7 +265,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_Point_);
expect(g).to.be.an(Point);
var expectedPoint = transform([1, 2], 'EPSG:4326', 'EPSG:3857');
expectedPoint.push(3);
expect(g.getCoordinates()).to.eql(expectedPoint);
@@ -287,7 +287,7 @@ describe('ol.format.KML', function() {
var f = format.readFeature(text);
expect(f).to.be.an(_ol_Feature_);
var g = f.getGeometry();
expect(g).to.be.an(_ol_geom_Point_);
expect(g).to.be.an(Point);
expect(g.getCoordinates()).to.eql([1, 2, 3]);
});
@@ -309,7 +309,7 @@ describe('ol.format.KML', function() {
});
expect(f).to.be.an(_ol_Feature_);
var g = f.getGeometry();
expect(g).to.be.an(_ol_geom_Point_);
expect(g).to.be.an(Point);
var expectedPoint = transform([1, 2], 'EPSG:4326', 'EPSG:3857');
expectedPoint.push(3);
expect(g.getCoordinates()).to.eql(expectedPoint);
@@ -317,7 +317,7 @@ describe('ol.format.KML', function() {
it('can write XY Point geometries', function() {
var layout = 'XY';
var point = new _ol_geom_Point_([1, 2], layout);
var point = new Point([1, 2], layout);
var features = [new _ol_Feature_(point)];
var node = format.writeFeaturesNode(features);
var text =
@@ -337,7 +337,7 @@ describe('ol.format.KML', function() {
it('can write XYZ Point geometries', function() {
var layout = 'XYZ';
var point = new _ol_geom_Point_([1, 2, 3], layout);
var point = new Point([1, 2, 3], layout);
var features = [new _ol_Feature_(point)];
var node = format.writeFeaturesNode(features);
var text =
@@ -366,7 +366,7 @@ describe('ol.format.KML', function() {
});
var layout = 'XYZ';
var point = new _ol_geom_Point_([1, 2, 3], layout).transform(
var point = new Point([1, 2, 3], layout).transform(
'EPSG:4326', 'double');
var features = [new _ol_Feature_(point)];
var node = format.writeFeaturesNode(features, {
@@ -394,7 +394,7 @@ describe('ol.format.KML', function() {
it('can write XYM Point geometries', function() {
var layout = 'XYM';
var point = new _ol_geom_Point_([1, 2, 100], layout);
var point = new Point([1, 2, 100], layout);
var features = [new _ol_Feature_(point)];
var node = format.writeFeaturesNode(features);
var text =
@@ -414,7 +414,7 @@ describe('ol.format.KML', function() {
it('can write XYZM Point geometries', function() {
var layout = 'XYZM';
var point = new _ol_geom_Point_([1, 2, 3, 100], layout);
var point = new Point([1, 2, 3, 100], layout);
var features = [new _ol_Feature_(point)];
var node = format.writeFeaturesNode(features);
var text =
@@ -1180,7 +1180,7 @@ describe('ol.format.KML', function() {
expect(g).to.be.an(_ol_geom_GeometryCollection_);
var gs = g.getGeometries();
expect(gs).to.have.length(4);
expect(gs[0]).to.be.an(_ol_geom_Point_);
expect(gs[0]).to.be.an(Point);
expect(gs[1]).to.be.an(_ol_geom_LineString_);
expect(gs[2]).to.be.an(_ol_geom_Polygon_);
expect(gs[3]).to.be.an(_ol_geom_Polygon_);
@@ -1209,7 +1209,7 @@ describe('ol.format.KML', function() {
it('can write GeometryCollection geometries', function() {
var collection = new _ol_geom_GeometryCollection_([
new _ol_geom_Point_([1, 2]),
new Point([1, 2]),
new _ol_geom_LineString_([[1, 2], [3, 4]]),
new _ol_geom_Polygon_([[[1, 2], [3, 4], [3, 2], [1, 2]]])
]);
@@ -2848,7 +2848,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_Point_);
expect(g).to.be.an(Point);
var expectedPoint = transform([1, 2], 'EPSG:4326', 'EPSG:3857');
expectedPoint.push(3);
expect(g.getCoordinates()).to.eql(expectedPoint);
@@ -3198,7 +3198,7 @@ describe('ol.format.KML', function() {
expect(geometry).to.be.an(_ol_geom_GeometryCollection_);
var components = geometry.getGeometries();
expect(components).to.have.length(2);
expect(components[0]).to.be.an(_ol_geom_Point_);
expect(components[0]).to.be.an(Point);
expect(components[1]).to.be.an(_ol_geom_MultiPolygon_);
});

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_MVT_ from '../../../../src/ol/format/MVT.js';
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_Polygon_ from '../../../../src/ol/geom/Polygon.js';
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
import _ol_render_Feature_ from '../../../../src/ol/render/Feature.js';
@@ -111,7 +111,7 @@ describe('ol.format.MVT', function() {
var feature = format.createFeature_({}, rawFeature);
_ol_format_MVT_.readRawGeometry_ = readRawGeometry_;
var geometry = feature.getGeometry();
expect(geometry).to.be.a(_ol_geom_Point_);
expect(geometry).to.be.a(Point);
expect(feature.get('myGeom')).to.equal(geometry);
expect(feature.get('geometry')).to.be('foo');
});

View File

@@ -1,6 +1,6 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_format_OSMXML_ from '../../../../src/ol/format/OSMXML.js';
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_geom_LineString_ from '../../../../src/ol/geom/LineString.js';
import {get as getProjection, transform} from '../../../../src/ol/proj.js';
@@ -51,7 +51,7 @@ describe('ol.format.OSMXML', function() {
var f = fs[0];
expect(f).to.be.an(_ol_Feature_);
var g = f.getGeometry();
expect(g).to.be.an(_ol_geom_Point_);
expect(g).to.be.an(Point);
expect(g.getCoordinates()).to.eql([2, 1]);
});
@@ -76,7 +76,7 @@ describe('ol.format.OSMXML', function() {
var point = fs[0];
expect(point).to.be.an(_ol_Feature_);
var g = point.getGeometry();
expect(g).to.be.an(_ol_geom_Point_);
expect(g).to.be.an(Point);
expect(g.getCoordinates()).to.eql([2, 1]);
var line = fs[2];
expect(line).to.be.an(_ol_Feature_);
@@ -130,7 +130,7 @@ describe('ol.format.OSMXML', function() {
var f = fs[0];
expect(f).to.be.an(_ol_Feature_);
var g = f.getGeometry();
expect(g).to.be.an(_ol_geom_Point_);
expect(g).to.be.an(Point);
expect(g.getCoordinates()).to.eql(
transform([2, 1], 'EPSG:4326', 'EPSG:3857'));
});

View File

@@ -1,5 +1,5 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_geom_Point_ from '../../../../src/ol/geom/Point.js';
import Point from '../../../../src/ol/geom/Point.js';
import _ol_format_WKT_ from '../../../../src/ol/format/WKT.js';
import {transform} from '../../../../src/ol/proj.js';
@@ -32,7 +32,7 @@ describe('ol.format.WKT', function() {
describe('#writeGeometry()', function() {
it('transforms with dataProjection and featureProjection', function() {
var geom = new _ol_geom_Point_([1, 2]).transform('EPSG:4326', 'EPSG:3857');
var geom = new Point([1, 2]).transform('EPSG:4326', 'EPSG:3857');
var wkt = format.writeGeometry(geom, {
dataProjection: 'EPSG:4326',
featureProjection: 'EPSG:3857'
@@ -63,7 +63,7 @@ describe('ol.format.WKT', function() {
it('transforms with dataProjection and featureProjection', function() {
var feature = new _ol_Feature_(
new _ol_geom_Point_([1, 2]).transform('EPSG:4326', 'EPSG:3857'));
new Point([1, 2]).transform('EPSG:4326', 'EPSG:3857'));
var wkt = format.writeFeature(feature, {
dataProjection: 'EPSG:4326',
featureProjection: 'EPSG:3857'
@@ -102,9 +102,9 @@ describe('ol.format.WKT', function() {
it('transforms with dataProjection and featureProjection', function() {
var features = [
new _ol_Feature_(
new _ol_geom_Point_([1, 2]).transform('EPSG:4326', 'EPSG:3857')),
new Point([1, 2]).transform('EPSG:4326', 'EPSG:3857')),
new _ol_Feature_(
new _ol_geom_Point_([4, 5]).transform('EPSG:4326', 'EPSG:3857'))
new Point([4, 5]).transform('EPSG:4326', 'EPSG:3857'))
];
var wkt = format.writeFeatures(features, {
dataProjection: 'EPSG:4326',