Remove use of shared vertices in geom package

This commit is contained in:
Tim Schaub
2013-09-25 15:06:53 +02:00
parent 3349bded1c
commit 2850c761cf
11 changed files with 54 additions and 304 deletions

View File

@@ -6,7 +6,6 @@ goog.require('ol.extent');
goog.require('ol.geom.Geometry');
goog.require('ol.geom.GeometryType');
goog.require('ol.geom.LinearRing');
goog.require('ol.geom.SharedVertices');
@@ -21,32 +20,17 @@ goog.require('ol.geom.SharedVertices');
* @extends {ol.geom.Geometry}
* @param {Array.<ol.CoordinateArray>} coordinates Array of rings. First
* is outer, any remaining are inner.
* @param {ol.geom.SharedVertices=} opt_shared Shared vertices.
*/
ol.geom.Polygon = function(coordinates, opt_shared) {
ol.geom.Polygon = function(coordinates) {
goog.base(this);
goog.asserts.assert(goog.isArray(coordinates[0][0]));
var vertices = opt_shared,
dimension;
if (!goog.isDef(vertices)) {
// try to get dimension from first vertex in first ring
dimension = coordinates[0][0].length;
vertices = new ol.geom.SharedVertices({dimension: dimension});
}
/**
* @private
* @type {ol.Coordinate}
*/
this.labelPoint_ = null;
/**
* @type {ol.geom.SharedVertices}
*/
this.vertices = vertices;
var numRings = coordinates.length;
/**
@@ -67,13 +51,13 @@ ol.geom.Polygon = function(coordinates, opt_shared) {
ringCoords.reverse();
}
}
this.rings[i] = new ol.geom.LinearRing(ringCoords, vertices);
this.rings[i] = new ol.geom.LinearRing(ringCoords);
}
/**
* @type {number}
*/
this.dimension = vertices.getDimension();
this.dimension = coordinates[0][0].length;
goog.asserts.assert(this.dimension >= 2);
};