Files
openlayers/externs/proj4js.js
Guillaume Beraudo 630d9c5200 Fix proj4 type
Previous typing was confusing the compiler. It could not figure out the
difference between the proj4 property and the constructor, which lead to
errors such as:

- ol.proj.setProj4(proj4)
ERR! compile /home/gberaudo/dev/ngeo/src/proj/epsg21781.js:8: ERROR - actual parameter 1 of ol.proj.setProj4 does not match formal parameter
ERR! compile found   : function (new:proj4): ?
ERR! compile required: (null|proj4)
ERR! compile   ol.proj.setProj4(proj4);
ERR! compile                    ^^^^^

- ol.proj.proj4.get().defs('EPSG:21781', epsg21781def)
ERR! compile /home/gberaudo/dev/ngeo/src/proj/epsg21781.js:26: ERROR - Property defs never defined on proj4
ERR! compile   ol.proj.proj4.get().defs('EPSG:21781', epsg21781def);
ERR! compile                       ^^^^
2017-03-22 09:47:29 +01:00

38 lines
611 B
JavaScript

/**
* @externs
* @see http://proj4js.org/
*/
/**
* @constructor
*/
var Proj4 = function() {};
/**
* @param {ol.Coordinate} coordinates
* @return {ol.Coordinate}
*/
Proj4.prototype.forward = function(coordinates) {};
/**
* @param {ol.Coordinate} coordinates
* @return {ol.Coordinate}
*/
Proj4.prototype.inverse = function(coordinates) {};
/**
* @param {string} name
* @param {(string|Object)=} opt_def
* @return {undefined|Object.<string, Object.<{axis: string, units: string, to_meter: number}>>}
*/
Proj4.prototype.defs = function(name, opt_def) {};
/**
* @type {Proj4}
*/
var proj4;