Rename _ol_geom_GeometryCollection_ to GeometryCollection
This commit is contained in:
@@ -9,7 +9,7 @@ import _ol_asserts_ from '../asserts.js';
|
||||
import _ol_Feature_ from '../Feature.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_JSONFeature_ from '../format/JSONFeature.js';
|
||||
import _ol_geom_GeometryCollection_ from '../geom/GeometryCollection.js';
|
||||
import GeometryCollection from '../geom/GeometryCollection.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
import MultiLineString from '../geom/MultiLineString.js';
|
||||
import MultiPoint from '../geom/MultiPoint.js';
|
||||
@@ -99,7 +99,7 @@ _ol_format_GeoJSON_.readGeometryCollectionGeometry_ = function(
|
||||
function(geometry) {
|
||||
return _ol_format_GeoJSON_.readGeometry_(geometry, opt_options);
|
||||
});
|
||||
return new _ol_geom_GeometryCollection_(geometries);
|
||||
return new GeometryCollection(geometries);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import _ol_color_ from '../color.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_XMLFeature_ from '../format/XMLFeature.js';
|
||||
import _ol_format_XSD_ from '../format/XSD.js';
|
||||
import _ol_geom_GeometryCollection_ from '../geom/GeometryCollection.js';
|
||||
import GeometryCollection from '../geom/GeometryCollection.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
@@ -911,7 +911,7 @@ _ol_format_KML_.readMultiGeometry_ = function(node, objectStack) {
|
||||
return null;
|
||||
}
|
||||
if (geometries.length === 0) {
|
||||
return new _ol_geom_GeometryCollection_(geometries);
|
||||
return new GeometryCollection(geometries);
|
||||
}
|
||||
/** @type {ol.geom.Geometry} */
|
||||
var multiGeometry;
|
||||
@@ -948,12 +948,12 @@ _ol_format_KML_.readMultiGeometry_ = function(node, objectStack) {
|
||||
multiGeometry.setPolygons(geometries);
|
||||
_ol_format_KML_.setCommonGeometryProperties_(multiGeometry, geometries);
|
||||
} else if (type == _ol_geom_GeometryType_.GEOMETRY_COLLECTION) {
|
||||
multiGeometry = new _ol_geom_GeometryCollection_(geometries);
|
||||
multiGeometry = new GeometryCollection(geometries);
|
||||
} else {
|
||||
_ol_asserts_.assert(false, 37); // Unknown geometry type found
|
||||
}
|
||||
} else {
|
||||
multiGeometry = new _ol_geom_GeometryCollection_(geometries);
|
||||
multiGeometry = new GeometryCollection(geometries);
|
||||
}
|
||||
return /** @type {ol.geom.Geometry} */ (multiGeometry);
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@ import {inherits} from '../index.js';
|
||||
import _ol_Feature_ from '../Feature.js';
|
||||
import _ol_format_Feature_ from '../format/Feature.js';
|
||||
import _ol_format_TextFeature_ from '../format/TextFeature.js';
|
||||
import _ol_geom_GeometryCollection_ from '../geom/GeometryCollection.js';
|
||||
import GeometryCollection from '../geom/GeometryCollection.js';
|
||||
import _ol_geom_GeometryType_ from '../geom/GeometryType.js';
|
||||
import _ol_geom_GeometryLayout_ from '../geom/GeometryLayout.js';
|
||||
import LineString from '../geom/LineString.js';
|
||||
@@ -386,7 +386,7 @@ _ol_format_WKT_.prototype.writeFeaturesText = function(features, opt_options) {
|
||||
for (var i = 0, ii = features.length; i < ii; ++i) {
|
||||
geometries.push(features[i].getGeometry());
|
||||
}
|
||||
var collection = new _ol_geom_GeometryCollection_(geometries);
|
||||
var collection = new GeometryCollection(geometries);
|
||||
return this.writeGeometryText(collection, opt_options);
|
||||
};
|
||||
|
||||
@@ -671,7 +671,7 @@ _ol_format_WKT_.Parser.prototype.parseGeometry_ = function() {
|
||||
this.layout_ = this.parseGeometryLayout_();
|
||||
if (geomType == _ol_geom_GeometryType_.GEOMETRY_COLLECTION.toUpperCase()) {
|
||||
var geometries = this.parseGeometryCollectionText_();
|
||||
return new _ol_geom_GeometryCollection_(geometries);
|
||||
return new GeometryCollection(geometries);
|
||||
} else {
|
||||
var parser = _ol_format_WKT_.Parser.GeometryParser_[geomType];
|
||||
var ctor = _ol_format_WKT_.Parser.GeometryConstructor_[geomType];
|
||||
|
||||
@@ -18,7 +18,7 @@ import _ol_obj_ from '../obj.js';
|
||||
* @param {Array.<ol.geom.Geometry>=} opt_geometries Geometries.
|
||||
* @api
|
||||
*/
|
||||
var _ol_geom_GeometryCollection_ = function(opt_geometries) {
|
||||
var GeometryCollection = function(opt_geometries) {
|
||||
|
||||
Geometry.call(this);
|
||||
|
||||
@@ -31,7 +31,7 @@ var _ol_geom_GeometryCollection_ = function(opt_geometries) {
|
||||
this.listenGeometriesChange_();
|
||||
};
|
||||
|
||||
inherits(_ol_geom_GeometryCollection_, Geometry);
|
||||
inherits(GeometryCollection, Geometry);
|
||||
|
||||
|
||||
/**
|
||||
@@ -39,7 +39,7 @@ inherits(_ol_geom_GeometryCollection_, Geometry);
|
||||
* @private
|
||||
* @return {Array.<ol.geom.Geometry>} Cloned geometries.
|
||||
*/
|
||||
_ol_geom_GeometryCollection_.cloneGeometries_ = function(geometries) {
|
||||
GeometryCollection.cloneGeometries_ = function(geometries) {
|
||||
var clonedGeometries = [];
|
||||
var i, ii;
|
||||
for (i = 0, ii = geometries.length; i < ii; ++i) {
|
||||
@@ -52,7 +52,7 @@ _ol_geom_GeometryCollection_.cloneGeometries_ = function(geometries) {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_ol_geom_GeometryCollection_.prototype.unlistenGeometriesChange_ = function() {
|
||||
GeometryCollection.prototype.unlistenGeometriesChange_ = function() {
|
||||
var i, ii;
|
||||
if (!this.geometries_) {
|
||||
return;
|
||||
@@ -68,7 +68,7 @@ _ol_geom_GeometryCollection_.prototype.unlistenGeometriesChange_ = function() {
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
_ol_geom_GeometryCollection_.prototype.listenGeometriesChange_ = function() {
|
||||
GeometryCollection.prototype.listenGeometriesChange_ = function() {
|
||||
var i, ii;
|
||||
if (!this.geometries_) {
|
||||
return;
|
||||
@@ -87,8 +87,8 @@ _ol_geom_GeometryCollection_.prototype.listenGeometriesChange_ = function() {
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_GeometryCollection_.prototype.clone = function() {
|
||||
var geometryCollection = new _ol_geom_GeometryCollection_(null);
|
||||
GeometryCollection.prototype.clone = function() {
|
||||
var geometryCollection = new GeometryCollection(null);
|
||||
geometryCollection.setGeometries(this.geometries_);
|
||||
return geometryCollection;
|
||||
};
|
||||
@@ -97,7 +97,7 @@ _ol_geom_GeometryCollection_.prototype.clone = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_geom_GeometryCollection_.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
|
||||
GeometryCollection.prototype.closestPointXY = function(x, y, closestPoint, minSquaredDistance) {
|
||||
if (minSquaredDistance < closestSquaredDistanceXY(this.getExtent(), x, y)) {
|
||||
return minSquaredDistance;
|
||||
}
|
||||
@@ -114,7 +114,7 @@ _ol_geom_GeometryCollection_.prototype.closestPointXY = function(x, y, closestPo
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_geom_GeometryCollection_.prototype.containsXY = function(x, y) {
|
||||
GeometryCollection.prototype.containsXY = function(x, y) {
|
||||
var geometries = this.geometries_;
|
||||
var i, ii;
|
||||
for (i = 0, ii = geometries.length; i < ii; ++i) {
|
||||
@@ -129,7 +129,7 @@ _ol_geom_GeometryCollection_.prototype.containsXY = function(x, y) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_geom_GeometryCollection_.prototype.computeExtent = function(extent) {
|
||||
GeometryCollection.prototype.computeExtent = function(extent) {
|
||||
createOrUpdateEmpty(extent);
|
||||
var geometries = this.geometries_;
|
||||
for (var i = 0, ii = geometries.length; i < ii; ++i) {
|
||||
@@ -144,15 +144,15 @@ _ol_geom_GeometryCollection_.prototype.computeExtent = function(extent) {
|
||||
* @return {Array.<ol.geom.Geometry>} Geometries.
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_GeometryCollection_.prototype.getGeometries = function() {
|
||||
return _ol_geom_GeometryCollection_.cloneGeometries_(this.geometries_);
|
||||
GeometryCollection.prototype.getGeometries = function() {
|
||||
return GeometryCollection.cloneGeometries_(this.geometries_);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @return {Array.<ol.geom.Geometry>} Geometries.
|
||||
*/
|
||||
_ol_geom_GeometryCollection_.prototype.getGeometriesArray = function() {
|
||||
GeometryCollection.prototype.getGeometriesArray = function() {
|
||||
return this.geometries_;
|
||||
};
|
||||
|
||||
@@ -160,7 +160,7 @@ _ol_geom_GeometryCollection_.prototype.getGeometriesArray = function() {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_geom_GeometryCollection_.prototype.getSimplifiedGeometry = function(squaredTolerance) {
|
||||
GeometryCollection.prototype.getSimplifiedGeometry = function(squaredTolerance) {
|
||||
if (this.simplifiedGeometryRevision != this.getRevision()) {
|
||||
_ol_obj_.clear(this.simplifiedGeometryCache);
|
||||
this.simplifiedGeometryMaxMinSquaredTolerance = 0;
|
||||
@@ -188,7 +188,7 @@ _ol_geom_GeometryCollection_.prototype.getSimplifiedGeometry = function(squaredT
|
||||
}
|
||||
}
|
||||
if (simplified) {
|
||||
var simplifiedGeometryCollection = new _ol_geom_GeometryCollection_(null);
|
||||
var simplifiedGeometryCollection = new GeometryCollection(null);
|
||||
simplifiedGeometryCollection.setGeometriesArray(simplifiedGeometries);
|
||||
this.simplifiedGeometryCache[key] = simplifiedGeometryCollection;
|
||||
return simplifiedGeometryCollection;
|
||||
@@ -204,7 +204,7 @@ _ol_geom_GeometryCollection_.prototype.getSimplifiedGeometry = function(squaredT
|
||||
* @inheritDoc
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_GeometryCollection_.prototype.getType = function() {
|
||||
GeometryCollection.prototype.getType = function() {
|
||||
return _ol_geom_GeometryType_.GEOMETRY_COLLECTION;
|
||||
};
|
||||
|
||||
@@ -213,7 +213,7 @@ _ol_geom_GeometryCollection_.prototype.getType = function() {
|
||||
* @inheritDoc
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_GeometryCollection_.prototype.intersectsExtent = function(extent) {
|
||||
GeometryCollection.prototype.intersectsExtent = function(extent) {
|
||||
var geometries = this.geometries_;
|
||||
var i, ii;
|
||||
for (i = 0, ii = geometries.length; i < ii; ++i) {
|
||||
@@ -228,7 +228,7 @@ _ol_geom_GeometryCollection_.prototype.intersectsExtent = function(extent) {
|
||||
/**
|
||||
* @return {boolean} Is empty.
|
||||
*/
|
||||
_ol_geom_GeometryCollection_.prototype.isEmpty = function() {
|
||||
GeometryCollection.prototype.isEmpty = function() {
|
||||
return this.geometries_.length === 0;
|
||||
};
|
||||
|
||||
@@ -237,7 +237,7 @@ _ol_geom_GeometryCollection_.prototype.isEmpty = function() {
|
||||
* @inheritDoc
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_GeometryCollection_.prototype.rotate = function(angle, anchor) {
|
||||
GeometryCollection.prototype.rotate = function(angle, anchor) {
|
||||
var geometries = this.geometries_;
|
||||
for (var i = 0, ii = geometries.length; i < ii; ++i) {
|
||||
geometries[i].rotate(angle, anchor);
|
||||
@@ -250,7 +250,7 @@ _ol_geom_GeometryCollection_.prototype.rotate = function(angle, anchor) {
|
||||
* @inheritDoc
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_GeometryCollection_.prototype.scale = function(sx, opt_sy, opt_anchor) {
|
||||
GeometryCollection.prototype.scale = function(sx, opt_sy, opt_anchor) {
|
||||
var anchor = opt_anchor;
|
||||
if (!anchor) {
|
||||
anchor = getCenter(this.getExtent());
|
||||
@@ -268,16 +268,16 @@ _ol_geom_GeometryCollection_.prototype.scale = function(sx, opt_sy, opt_anchor)
|
||||
* @param {Array.<ol.geom.Geometry>} geometries Geometries.
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_GeometryCollection_.prototype.setGeometries = function(geometries) {
|
||||
GeometryCollection.prototype.setGeometries = function(geometries) {
|
||||
this.setGeometriesArray(
|
||||
_ol_geom_GeometryCollection_.cloneGeometries_(geometries));
|
||||
GeometryCollection.cloneGeometries_(geometries));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array.<ol.geom.Geometry>} geometries Geometries.
|
||||
*/
|
||||
_ol_geom_GeometryCollection_.prototype.setGeometriesArray = function(geometries) {
|
||||
GeometryCollection.prototype.setGeometriesArray = function(geometries) {
|
||||
this.unlistenGeometriesChange_();
|
||||
this.geometries_ = geometries;
|
||||
this.listenGeometriesChange_();
|
||||
@@ -289,7 +289,7 @@ _ol_geom_GeometryCollection_.prototype.setGeometriesArray = function(geometries)
|
||||
* @inheritDoc
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_GeometryCollection_.prototype.applyTransform = function(transformFn) {
|
||||
GeometryCollection.prototype.applyTransform = function(transformFn) {
|
||||
var geometries = this.geometries_;
|
||||
var i, ii;
|
||||
for (i = 0, ii = geometries.length; i < ii; ++i) {
|
||||
@@ -306,7 +306,7 @@ _ol_geom_GeometryCollection_.prototype.applyTransform = function(transformFn) {
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
_ol_geom_GeometryCollection_.prototype.translate = function(deltaX, deltaY) {
|
||||
GeometryCollection.prototype.translate = function(deltaX, deltaY) {
|
||||
var geometries = this.geometries_;
|
||||
var i, ii;
|
||||
for (i = 0, ii = geometries.length; i < ii; ++i) {
|
||||
@@ -319,8 +319,8 @@ _ol_geom_GeometryCollection_.prototype.translate = function(deltaX, deltaY) {
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
_ol_geom_GeometryCollection_.prototype.disposeInternal = function() {
|
||||
GeometryCollection.prototype.disposeInternal = function() {
|
||||
this.unlistenGeometriesChange_();
|
||||
Geometry.prototype.disposeInternal.call(this);
|
||||
};
|
||||
export default _ol_geom_GeometryCollection_;
|
||||
export default GeometryCollection;
|
||||
|
||||
@@ -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