Add getBounds to geometry

This commit is contained in:
Tim Schaub
2013-01-21 12:59:04 -07:00
parent 216d30ddc1
commit b4d44f815f
16 changed files with 418 additions and 16 deletions
+5 -3
View File
@@ -2,17 +2,18 @@ goog.provide('ol.geom.MultiLineString');
goog.require('goog.asserts');
goog.require('ol.geom.CoordinateArray');
goog.require('ol.geom.Geometry');
goog.require('ol.geom.GeometryCollection');
goog.require('ol.geom.LineString');
/**
* @constructor
* @implements {ol.geom.Geometry}
* @extends {ol.geom.GeometryCollection}
* @param {Array.<ol.geom.CoordinateArray>} coordinates Coordinates array.
*/
ol.geom.MultiLineString = function(coordinates) {
goog.base(this);
var numParts = coordinates.length,
dimension;
@@ -24,7 +25,7 @@ ol.geom.MultiLineString = function(coordinates) {
for (var i = 0; i < numParts; ++i) {
this.components[i] = new ol.geom.LineString(coordinates[i]);
if (!goog.isDef(dimension)) {
dimension = this.components[i];
dimension = this.components[i].dimension;
} else {
goog.asserts.assert(this.components[i].dimension === dimension);
}
@@ -37,3 +38,4 @@ ol.geom.MultiLineString = function(coordinates) {
goog.asserts.assert(this.dimension >= 2);
};
goog.inherits(ol.geom.MultiLineString, ol.geom.GeometryCollection);