Point, linestring, and linearring coordinates as Float32Array
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
goog.provide('ol.geom.Point');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.vec.Float32Array');
|
||||
goog.require('ol.geom.Coordinate');
|
||||
goog.require('ol.geom.Geometry');
|
||||
|
||||
|
||||
@@ -7,13 +10,19 @@ goog.require('ol.geom.Geometry');
|
||||
/**
|
||||
* @constructor
|
||||
* @implements {ol.geom.Geometry}
|
||||
* @param {Array} coordinates Coordinates array.
|
||||
* @param {ol.geom.Coordinate} coordinates Coordinates array (e.g. [x, y]).
|
||||
*/
|
||||
ol.geom.Point = function(coordinates) {
|
||||
|
||||
/**
|
||||
* @type {Array}
|
||||
* @type {Float32Array}
|
||||
*/
|
||||
this.coordinates = coordinates;
|
||||
this.coordinates = new Float32Array(coordinates);
|
||||
|
||||
/**
|
||||
* @type {number}
|
||||
*/
|
||||
this.dimension = coordinates.length;
|
||||
goog.asserts.assert(this.dimension >= 2);
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user