Point, linestring, and linearring coordinates as Float32Array
This commit is contained in:
@@ -1,19 +1,39 @@
|
||||
goog.provide('ol.geom.MultiPoint');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('ol.geom.CoordinateArray');
|
||||
goog.require('ol.geom.Geometry');
|
||||
goog.require('ol.geom.Point');
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @implements {ol.geom.Geometry}
|
||||
* @param {Array} coordinates Coordinates array.
|
||||
* @param {ol.geom.CoordinateArray} coordinates Coordinates array.
|
||||
*/
|
||||
ol.geom.MultiPoint = function(coordinates) {
|
||||
|
||||
var numParts = coordinates.length,
|
||||
dimension;
|
||||
|
||||
/**
|
||||
* @type {Array}
|
||||
* @type {Array.<ol.geom.Point>}
|
||||
*/
|
||||
this.coordinates = coordinates;
|
||||
this.components = new Array(numParts);
|
||||
for (var i = 0; i < numParts; ++i) {
|
||||
this.components[i] = new ol.geom.Point(coordinates[i]);
|
||||
if (!goog.isDef(dimension)) {
|
||||
dimension = this.components[i].dimension;
|
||||
} else {
|
||||
goog.asserts.assert(this.components[i].dimension === dimension);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
this.dimension = dimension;
|
||||
goog.asserts.assert(this.dimension >= 2);
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user