Optionally extend ol.Coordinate to the third dimension
We continue to inherit from goog.math.Vec2 instead of goog.math.Vec3 because goog.math.Vec2 better represents a position in space, with appropriate functionality, whereas goog.math.Vec3 represents a direction and magnitude.
This commit is contained in:
@@ -19,9 +19,17 @@ ol.CoordinateFormatType;
|
|||||||
* @extends {goog.math.Vec2}
|
* @extends {goog.math.Vec2}
|
||||||
* @param {number} x X.
|
* @param {number} x X.
|
||||||
* @param {number} y Y.
|
* @param {number} y Y.
|
||||||
|
* @param {number=} opt_z Z.
|
||||||
*/
|
*/
|
||||||
ol.Coordinate = function(x, y) {
|
ol.Coordinate = function(x, y, opt_z) {
|
||||||
|
|
||||||
goog.base(this, x, y);
|
goog.base(this, x, y);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {number}
|
||||||
|
*/
|
||||||
|
this.z = opt_z || 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
goog.inherits(ol.Coordinate, goog.math.Vec2);
|
goog.inherits(ol.Coordinate, goog.math.Vec2);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user