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:
@@ -6850,7 +6850,7 @@ olx.view.FitGeometryOptions.prototype.maxZoom;
|
||||
/**
|
||||
* @typedef {{animate: boolean,
|
||||
* attributions: Object.<string, ol.Attribution>,
|
||||
* coordinateToPixelMatrix: goog.vec.Mat4.Number,
|
||||
* coordinateToPixelMatrix: ol.vec.Mat4.Number,
|
||||
* extent: (null|ol.Extent),
|
||||
* focus: ol.Coordinate,
|
||||
* index: number,
|
||||
@@ -6858,7 +6858,7 @@ olx.view.FitGeometryOptions.prototype.maxZoom;
|
||||
* layerStatesArray: Array.<ol.layer.LayerState>,
|
||||
* logos: Object.<string, string>,
|
||||
* pixelRatio: number,
|
||||
* pixelToCoordinateMatrix: goog.vec.Mat4.Number,
|
||||
* pixelToCoordinateMatrix: ol.vec.Mat4.Number,
|
||||
* postRenderFunctions: Array.<ol.PostRenderFunction>,
|
||||
* size: ol.Size,
|
||||
* skippedFeatureUids: Object.<string, boolean>,
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user