Add a type alias to goog.vec.Number

This addition is related to the definition of olx.FrameState in olx.js. Without this alias and corresponding goog.provide in src/ol/vec/mat4.js we get this error when compiling an OpenLayers application:

ERR! compile node_modules/openlayers/externs/olx.js:6853: ERROR - Bad type annotation. Unknown type goog.vec.Mat4.Number
ERR! compile  *     coordinateToPixelMatrix: goog.vec.Mat4.Number,

Currently, the Closure Library does not have a goog.provide for goog.vec.Mat4.Number. If it did have this goog.provide then we wouldn't have the error.

This commit works around the issue by creating our own type alias (ol.vec.Mat4.Number) and adding a goog.provide for that type alias.
This commit is contained in:
Éric Lemoine
2015-04-07 14:01:12 +02:00
parent e45c44fa01
commit 765fc4c279
2 changed files with 10 additions and 2 deletions

View File

@@ -1,8 +1,16 @@
goog.provide('ol.vec.Mat4');
goog.provide('ol.vec.Mat4.Number');
goog.require('goog.vec.Mat4');
/**
* A alias for the goog.vec.Number type.
* @typedef {goog.vec.Number}
*/
ol.vec.Mat4.Number;
/**
* @param {!goog.vec.Mat4.Number} mat Matrix.
* @param {number} translateX1 Translate X1.