Remove use of shared vertices in geom package
This commit is contained in:
@@ -5,7 +5,6 @@ goog.require('ol.CoordinateArray');
|
||||
goog.require('ol.geom.AbstractCollection');
|
||||
goog.require('ol.geom.GeometryType');
|
||||
goog.require('ol.geom.Point');
|
||||
goog.require('ol.geom.SharedVertices');
|
||||
|
||||
|
||||
|
||||
@@ -13,26 +12,11 @@ goog.require('ol.geom.SharedVertices');
|
||||
* @constructor
|
||||
* @extends {ol.geom.AbstractCollection}
|
||||
* @param {ol.CoordinateArray} coordinates Coordinates array.
|
||||
* @param {ol.geom.SharedVertices=} opt_shared Shared vertices.
|
||||
*/
|
||||
ol.geom.MultiPoint = function(coordinates, opt_shared) {
|
||||
ol.geom.MultiPoint = function(coordinates) {
|
||||
goog.base(this);
|
||||
goog.asserts.assert(goog.isArray(coordinates[0]));
|
||||
|
||||
var vertices = opt_shared,
|
||||
dimension;
|
||||
|
||||
if (!goog.isDef(vertices)) {
|
||||
// try to get dimension from first vertex
|
||||
dimension = coordinates[0].length;
|
||||
vertices = new ol.geom.SharedVertices({dimension: dimension});
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {ol.geom.SharedVertices}
|
||||
*/
|
||||
this.vertices = vertices;
|
||||
|
||||
var numParts = coordinates.length;
|
||||
|
||||
/**
|
||||
@@ -40,13 +24,13 @@ ol.geom.MultiPoint = function(coordinates, opt_shared) {
|
||||
*/
|
||||
this.components = new Array(numParts);
|
||||
for (var i = 0; i < numParts; ++i) {
|
||||
this.components[i] = new ol.geom.Point(coordinates[i], vertices);
|
||||
this.components[i] = new ol.geom.Point(coordinates[i]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
this.dimension = vertices.getDimension();
|
||||
this.dimension = coordinates[0].length;
|
||||
|
||||
};
|
||||
goog.inherits(ol.geom.MultiPoint, ol.geom.AbstractCollection);
|
||||
@@ -64,14 +48,13 @@ ol.geom.MultiPoint.prototype.getType = function() {
|
||||
* Create a multi-point geometry from an array of point geometries.
|
||||
*
|
||||
* @param {Array.<ol.geom.Point>} geometries Array of geometries.
|
||||
* @param {ol.geom.SharedVertices=} opt_shared Shared vertices.
|
||||
* @return {ol.geom.MultiPoint} A new geometry.
|
||||
*/
|
||||
ol.geom.MultiPoint.fromParts = function(geometries, opt_shared) {
|
||||
ol.geom.MultiPoint.fromParts = function(geometries) {
|
||||
var count = geometries.length;
|
||||
var coordinates = new Array(count);
|
||||
for (var i = 0; i < count; ++i) {
|
||||
coordinates[i] = geometries[i].getCoordinates();
|
||||
}
|
||||
return new ol.geom.MultiPoint(coordinates, opt_shared);
|
||||
return new ol.geom.MultiPoint(coordinates);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user