Rename _ol_geom_GeometryCollection_ to GeometryCollection
This commit is contained in:
@@ -2,7 +2,7 @@ import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||
import * as _ol_extent_ from '../../../../src/ol/extent.js';
|
||||
import _ol_format_GeoJSON_ from '../../../../src/ol/format/GeoJSON.js';
|
||||
import Circle from '../../../../src/ol/geom/Circle.js';
|
||||
import _ol_geom_GeometryCollection_ from '../../../../src/ol/geom/GeometryCollection.js';
|
||||
import GeometryCollection from '../../../../src/ol/geom/GeometryCollection.js';
|
||||
import LineString from '../../../../src/ol/geom/LineString.js';
|
||||
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
|
||||
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
|
||||
@@ -414,7 +414,7 @@ describe('ol.format.GeoJSON', function() {
|
||||
});
|
||||
|
||||
var geometryCollection = format.readGeometry(str);
|
||||
expect(geometryCollection).to.be.an(_ol_geom_GeometryCollection_);
|
||||
expect(geometryCollection).to.be.an(GeometryCollection);
|
||||
var array = geometryCollection.getGeometries();
|
||||
expect(array.length).to.be(2);
|
||||
expect(array[0]).to.be.a(Point);
|
||||
@@ -729,13 +729,13 @@ describe('ol.format.GeoJSON', function() {
|
||||
});
|
||||
|
||||
it('encodes geometry collection', function() {
|
||||
var collection = new _ol_geom_GeometryCollection_([
|
||||
var collection = new GeometryCollection([
|
||||
new Point([10, 20]),
|
||||
new LineString([[30, 40], [50, 60]])
|
||||
]);
|
||||
var geojson = format.writeGeometry(collection);
|
||||
var got = format.readGeometry(geojson);
|
||||
expect(got).to.be.an(_ol_geom_GeometryCollection_);
|
||||
expect(got).to.be.an(GeometryCollection);
|
||||
var gotGeometries = got.getGeometries();
|
||||
var geometries = collection.getGeometries();
|
||||
expect(geometries.length).to.equal(gotGeometries.length);
|
||||
@@ -770,7 +770,7 @@ describe('ol.format.GeoJSON', function() {
|
||||
});
|
||||
|
||||
it('transforms and encodes geometry collection', function() {
|
||||
var collection = new _ol_geom_GeometryCollection_([
|
||||
var collection = new GeometryCollection([
|
||||
new Point([2, 3]),
|
||||
new LineString([[3, 2], [2, 1]])
|
||||
]);
|
||||
|
||||
@@ -2,7 +2,7 @@ import _ol_Feature_ from '../../../../src/ol/Feature.js';
|
||||
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 GeometryCollection from '../../../../src/ol/geom/GeometryCollection.js';
|
||||
import LineString from '../../../../src/ol/geom/LineString.js';
|
||||
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
|
||||
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
|
||||
@@ -1144,7 +1144,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_GeometryCollection_);
|
||||
expect(g).to.be.an(GeometryCollection);
|
||||
expect(g.getGeometries()).to.be.empty();
|
||||
});
|
||||
|
||||
@@ -1177,7 +1177,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_GeometryCollection_);
|
||||
expect(g).to.be.an(GeometryCollection);
|
||||
var gs = g.getGeometries();
|
||||
expect(gs).to.have.length(4);
|
||||
expect(gs[0]).to.be.an(Point);
|
||||
@@ -1201,14 +1201,14 @@ 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_GeometryCollection_);
|
||||
expect(g).to.be.an(GeometryCollection);
|
||||
var gs = g.getGeometries();
|
||||
expect(gs).to.have.length(1);
|
||||
expect(gs[0]).to.be.an(_ol_geom_GeometryCollection_);
|
||||
expect(gs[0]).to.be.an(GeometryCollection);
|
||||
});
|
||||
|
||||
it('can write GeometryCollection geometries', function() {
|
||||
var collection = new _ol_geom_GeometryCollection_([
|
||||
var collection = new GeometryCollection([
|
||||
new Point([1, 2]),
|
||||
new LineString([[1, 2], [3, 4]]),
|
||||
new Polygon([[[1, 2], [3, 4], [3, 2], [1, 2]]])
|
||||
@@ -3112,7 +3112,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_GeometryCollection_);
|
||||
expect(g).to.be.an(GeometryCollection);
|
||||
expect(g.getGeometries()).to.be.empty();
|
||||
});
|
||||
|
||||
@@ -3186,7 +3186,7 @@ describe('ol.format.KML', function() {
|
||||
var feature = features[0];
|
||||
expect(feature).to.be.an(_ol_Feature_);
|
||||
var geometry = feature.getGeometry();
|
||||
expect(geometry).to.be.an(_ol_geom_GeometryCollection_);
|
||||
expect(geometry).to.be.an(GeometryCollection);
|
||||
});
|
||||
|
||||
it('creates a Point and a MultiPolygon for Alaska', function() {
|
||||
@@ -3195,7 +3195,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
expect(alaska).to.be.an(_ol_Feature_);
|
||||
var geometry = alaska.getGeometry();
|
||||
expect(geometry).to.be.an(_ol_geom_GeometryCollection_);
|
||||
expect(geometry).to.be.an(GeometryCollection);
|
||||
var components = geometry.getGeometries();
|
||||
expect(components).to.have.length(2);
|
||||
expect(components[0]).to.be.an(Point);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Geometry from '../../../../src/ol/geom/Geometry.js';
|
||||
import _ol_geom_GeometryCollection_ from '../../../../src/ol/geom/GeometryCollection.js';
|
||||
import GeometryCollection from '../../../../src/ol/geom/GeometryCollection.js';
|
||||
import LineString from '../../../../src/ol/geom/LineString.js';
|
||||
import Point from '../../../../src/ol/geom/Point.js';
|
||||
import Polygon from '../../../../src/ol/geom/Polygon.js';
|
||||
@@ -17,11 +17,11 @@ describe('ol.geom.GeometryCollection', function() {
|
||||
point = new Point([10, 20]);
|
||||
line = new LineString([[10, 20], [30, 40]]);
|
||||
poly = new Polygon([outer, inner1, inner2]);
|
||||
multi = new _ol_geom_GeometryCollection_([point, line, poly]);
|
||||
multi = new GeometryCollection([point, line, poly]);
|
||||
});
|
||||
|
||||
it('creates a geometry collection from an array of geometries', function() {
|
||||
expect(multi).to.be.a(_ol_geom_GeometryCollection_);
|
||||
expect(multi).to.be.a(GeometryCollection);
|
||||
expect(multi).to.be.a(Geometry);
|
||||
});
|
||||
|
||||
@@ -59,7 +59,7 @@ describe('ol.geom.GeometryCollection', function() {
|
||||
var point = new Point([10, 20]);
|
||||
var line = new LineString([[10, 20], [30, 40]]);
|
||||
var poly = new Polygon([outer, inner1, inner2]);
|
||||
var multi = new _ol_geom_GeometryCollection_([point, line, poly]);
|
||||
var multi = new GeometryCollection([point, line, poly]);
|
||||
|
||||
var geometries = multi.getGeometries();
|
||||
expect(geometries).to.be.an(Array);
|
||||
@@ -77,7 +77,7 @@ describe('ol.geom.GeometryCollection', function() {
|
||||
var point = new Point([10, 20]);
|
||||
var line = new LineString([[10, 20], [30, 40]]);
|
||||
var poly = new Polygon([outer, inner1, inner2]);
|
||||
var multi = new _ol_geom_GeometryCollection_([point, line, poly]);
|
||||
var multi = new GeometryCollection([point, line, poly]);
|
||||
var clone = multi.clone();
|
||||
expect(clone).to.not.be(multi);
|
||||
var geometries = clone.getGeometries();
|
||||
@@ -89,7 +89,7 @@ describe('ol.geom.GeometryCollection', function() {
|
||||
it('does a deep clone', function() {
|
||||
var point = new Point([30, 40]);
|
||||
var originalGeometries = [point];
|
||||
var multi = new _ol_geom_GeometryCollection_(originalGeometries);
|
||||
var multi = new GeometryCollection(originalGeometries);
|
||||
var clone = multi.clone();
|
||||
var clonedGeometries = clone.getGeometries();
|
||||
expect(clonedGeometries).not.to.be(originalGeometries);
|
||||
@@ -107,7 +107,7 @@ describe('ol.geom.GeometryCollection', function() {
|
||||
it('returns the bounding extent', function() {
|
||||
var point = new Point([10, 2]);
|
||||
var line = new LineString([[1, 20], [30, 40]]);
|
||||
var multi = new _ol_geom_GeometryCollection_([point, line]);
|
||||
var multi = new GeometryCollection([point, line]);
|
||||
var extent = multi.getExtent();
|
||||
expect(extent[0]).to.be(1);
|
||||
expect(extent[2]).to.be(30);
|
||||
@@ -125,7 +125,7 @@ describe('ol.geom.GeometryCollection', function() {
|
||||
point = new Point([5, 20]);
|
||||
line = new LineString([[10, 20], [30, 40]]);
|
||||
poly = new Polygon([outer, inner1, inner2]);
|
||||
multi = new _ol_geom_GeometryCollection_([point, line, poly]);
|
||||
multi = new GeometryCollection([point, line, poly]);
|
||||
});
|
||||
|
||||
it('returns true for intersecting point', function() {
|
||||
@@ -154,7 +154,7 @@ describe('ol.geom.GeometryCollection', function() {
|
||||
point = new Point([10, 20]);
|
||||
line = new LineString([[10, 20], [30, 40]]);
|
||||
poly = new Polygon([outer, inner1, inner2]);
|
||||
multi = new _ol_geom_GeometryCollection_([point, line, poly]);
|
||||
multi = new GeometryCollection([point, line, poly]);
|
||||
});
|
||||
|
||||
it('fires a change event', function() {
|
||||
@@ -175,7 +175,7 @@ describe('ol.geom.GeometryCollection', function() {
|
||||
describe('#scale()', function() {
|
||||
|
||||
it('scales a collection', function() {
|
||||
var geom = new _ol_geom_GeometryCollection_([
|
||||
var geom = new GeometryCollection([
|
||||
new Point([-1, -2]),
|
||||
new LineString([[0, 0], [1, 2]])
|
||||
]);
|
||||
@@ -186,7 +186,7 @@ describe('ol.geom.GeometryCollection', function() {
|
||||
});
|
||||
|
||||
it('accepts sx and sy', function() {
|
||||
var geom = new _ol_geom_GeometryCollection_([
|
||||
var geom = new GeometryCollection([
|
||||
new Point([-1, -2]),
|
||||
new LineString([[0, 0], [1, 2]])
|
||||
]);
|
||||
@@ -197,7 +197,7 @@ describe('ol.geom.GeometryCollection', function() {
|
||||
});
|
||||
|
||||
it('accepts an anchor', function() {
|
||||
var geom = new _ol_geom_GeometryCollection_([
|
||||
var geom = new GeometryCollection([
|
||||
new Point([-1, -2]),
|
||||
new LineString([[0, 0], [1, 2]])
|
||||
]);
|
||||
@@ -215,7 +215,7 @@ describe('ol.geom.GeometryCollection', function() {
|
||||
beforeEach(function() {
|
||||
point = new Point([10, 20]);
|
||||
line = new LineString([[10, 20], [30, 40]]);
|
||||
multi = new _ol_geom_GeometryCollection_([point, line]);
|
||||
multi = new GeometryCollection([point, line]);
|
||||
});
|
||||
|
||||
it('transforms all geometries', function() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Circle from '../../../../../src/ol/geom/Circle.js';
|
||||
import _ol_geom_GeometryCollection_ from '../../../../../src/ol/geom/GeometryCollection.js';
|
||||
import GeometryCollection from '../../../../../src/ol/geom/GeometryCollection.js';
|
||||
import LineString from '../../../../../src/ol/geom/LineString.js';
|
||||
import MultiLineString from '../../../../../src/ol/geom/MultiLineString.js';
|
||||
import MultiPoint from '../../../../../src/ol/geom/MultiPoint.js';
|
||||
@@ -138,7 +138,7 @@ describe('ol.render.canvas.Immediate', function() {
|
||||
var linestring = new LineString([[1, 2], [3, 4]]);
|
||||
var polygon = new Polygon([[[1, 2], [3, 4], [5, 6], [1, 2]]]);
|
||||
|
||||
var geometry = new _ol_geom_GeometryCollection_([point, linestring, polygon]);
|
||||
var geometry = new GeometryCollection([point, linestring, polygon]);
|
||||
context.drawGeometry(geometry);
|
||||
|
||||
expect(context.drawGeometryCollection.calledOnce).to.be(true);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import _ol_Feature_ from '../../../../../src/ol/Feature.js';
|
||||
import Circle from '../../../../../src/ol/geom/Circle.js';
|
||||
import _ol_geom_GeometryCollection_ from '../../../../../src/ol/geom/GeometryCollection.js';
|
||||
import GeometryCollection from '../../../../../src/ol/geom/GeometryCollection.js';
|
||||
import LineString from '../../../../../src/ol/geom/LineString.js';
|
||||
import MultiLineString from '../../../../../src/ol/geom/MultiLineString.js';
|
||||
import MultiPoint from '../../../../../src/ol/geom/MultiPoint.js';
|
||||
@@ -86,7 +86,7 @@ describe('ol.render.webgl.Immediate', function() {
|
||||
describe('#drawGeometryCollection', function() {
|
||||
var geomColl;
|
||||
beforeEach(function() {
|
||||
geomColl = new _ol_geom_GeometryCollection_([circle, point, multiPoint,
|
||||
geomColl = new GeometryCollection([circle, point, multiPoint,
|
||||
line, multiLine, polygon, multiPolygon]);
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
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 GeometryCollection from '../../../../../src/ol/geom/GeometryCollection.js';
|
||||
import LineString from '../../../../../src/ol/geom/LineString.js';
|
||||
import MultiLineString from '../../../../../src/ol/geom/MultiLineString.js';
|
||||
import MultiPoint from '../../../../../src/ol/geom/MultiPoint.js';
|
||||
@@ -239,7 +239,7 @@ describe('ol.render.canvas.ReplayGroup', function() {
|
||||
var polygon = feature1;
|
||||
var multipolygon = new _ol_Feature_(new MultiPolygon(
|
||||
[polygon.getGeometry().getCoordinates(), polygon.getGeometry().getCoordinates()]));
|
||||
var geometrycollection = new _ol_Feature_(new _ol_geom_GeometryCollection_(
|
||||
var geometrycollection = new _ol_Feature_(new GeometryCollection(
|
||||
[point.getGeometry(), linestring.getGeometry(), polygon.getGeometry()]));
|
||||
replay = new _ol_render_canvas_ReplayGroup_(1, [-180, -90, 180, 90], 1, 1, true);
|
||||
_ol_renderer_vector_.renderFeature(replay, point, style, 1);
|
||||
|
||||
@@ -4,7 +4,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 GeometryCollection from '../../../src/ol/geom/GeometryCollection.js';
|
||||
import LineString from '../../../src/ol/geom/LineString.js';
|
||||
import MultiLineString from '../../../src/ol/geom/MultiLineString.js';
|
||||
import MultiPoint from '../../../src/ol/geom/MultiPoint.js';
|
||||
@@ -154,7 +154,7 @@ describe('ol.Sphere.getLength()', function() {
|
||||
options: {projection: 'EPSG:4326'},
|
||||
length: 2 * 4407939.124914191
|
||||
}, {
|
||||
geometry: new _ol_geom_GeometryCollection_([
|
||||
geometry: new GeometryCollection([
|
||||
new LineString([
|
||||
[115, -32],
|
||||
[131, -22],
|
||||
|
||||
Reference in New Issue
Block a user