diff --git a/externs/olx.js b/externs/olx.js index 949efbb640..89a00b2617 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -5,88 +5,6 @@ let olx; -/** - * Object literal with config options for the projection. - * @typedef {{code: string, - * units: (ol.proj.Units|string|undefined), - * extent: (ol.Extent|undefined), - * axisOrientation: (string|undefined), - * global: (boolean|undefined), - * metersPerUnit: (number|undefined), - * worldExtent: (ol.Extent|undefined), - * getPointResolution: (function(number, ol.Coordinate):number|undefined) }} - */ -olx.ProjectionOptions; - - -/** - * The SRS identifier code, e.g. `EPSG:4326`. - * @type {string} - * @api - */ -olx.ProjectionOptions.prototype.code; - - -/** - * Units. Required unless a proj4 projection is defined for `code`. - * @type {ol.proj.Units|string|undefined} - * @api - */ -olx.ProjectionOptions.prototype.units; - - -/** - * The validity extent for the SRS. - * @type {ol.Extent|undefined} - * @api - */ -olx.ProjectionOptions.prototype.extent; - - -/** - * The axis orientation as specified in Proj4. The default is `enu`. - * @type {string|undefined} - * @api - */ -olx.ProjectionOptions.prototype.axisOrientation; - - -/** - * Whether the projection is valid for the whole globe. Default is `false`. - * @type {boolean|undefined} - * @api - */ -olx.ProjectionOptions.prototype.global; - - -/** - * The meters per unit for the SRS. If not provided, the `units` are used to get - * the meters per unit from the {@link ol.proj.METERS_PER_UNIT} lookup table. - * @type {number|undefined} - * @api - */ -olx.ProjectionOptions.prototype.metersPerUnit; - - -/** - * The world extent for the SRS. - * @type {ol.Extent|undefined} - * @api - */ -olx.ProjectionOptions.prototype.worldExtent; - - -/** - * Function to determine resolution at a point. The function is called with a - * `{number}` view resolution and an `{ol.Coordinate}` as arguments, and returns - * the `{number}` resolution at the passed coordinate. If this is `undefined`, - * the default {@link ol.proj#getPointResolution} function will be used. - * @type {(function(number, ol.Coordinate):number|undefined)} - * @api - */ -olx.ProjectionOptions.prototype.getPointResolution; - - /** * @typedef {{ * center: (ol.Coordinate|undefined), diff --git a/externs/xol.js b/externs/xol.js index 129fafce20..bc2ece3e65 100644 --- a/externs/xol.js +++ b/externs/xol.js @@ -1,21 +1,4 @@ -/** - * @typedef {Object} ProjectionOptions - * @property {string} code The SRS identifier code, e.g. `EPSG:4326`. - * @property {ol.proj.Units|string|undefined} units Units. Required unless a proj4 projection is defined for `code`. - * @property {ol.Extent|undefined} extent The validity extent for the SRS. - * @property {string|undefined} axisOrientation The axis orientation as specified in Proj4. The default is `enu`. - * @property {boolean|undefined} global Whether the projection is valid for the whole globe. Default is `false`. - * @property {number|undefined} metersPerUnit The meters per unit for the SRS. If not provided, the `units` are used to get - * the meters per unit from the {@link ol.proj.METERS_PER_UNIT} lookup table. - * @property {ol.Extent|undefined} worldExtent The world extent for the SRS. - * @property {(function(number, ol.Coordinate):number|undefined)} getPointResolution Function to determine resolution at a point. The function is called with a - * `{number}` view resolution and an `{ol.Coordinate}` as arguments, and returns - * the `{number}` resolution at the passed coordinate. If this is `undefined`, - * the default {@link ol.proj#getPointResolution} function will be used. - */ - - /** * @typedef {Object} AnimationOptions * @property {ol.Coordinate|undefined} center The center of the view at the end of the animation. diff --git a/src/ol/proj/Projection.js b/src/ol/proj/Projection.js index eb572f0ebc..5829dbb780 100644 --- a/src/ol/proj/Projection.js +++ b/src/ol/proj/Projection.js @@ -3,6 +3,29 @@ */ import {METERS_PER_UNIT} from '../proj/Units.js'; + +/** + * @typedef {Object} Options + * @property {string} code The SRS identifier code, e.g. `EPSG:4326`. + * @property {ol.proj.Units|string|undefined} units Units. Required unless a + * proj4 projection is defined for `code`. + * @property {ol.Extent|undefined} extent The validity extent for the SRS. + * @property {string|undefined} axisOrientation The axis orientation as specified + * in Proj4. The default is `enu`. + * @property {boolean|undefined} global Whether the projection is valid for the + * whole globe. Default is `false`. + * @property {number|undefined} metersPerUnit The meters per unit for the SRS. + * If not provided, the `units` are used to get the meters per unit from the {@link ol.proj.METERS_PER_UNIT} + * lookup table. + * @property {ol.Extent|undefined} worldExtent The world extent for the SRS. + * @property {(function(number, ol.Coordinate):number|undefined)} getPointResolution + * Function to determine resolution at a point. The function is called with a + * `{number}` view resolution and an `{ol.Coordinate}` as arguments, and returns + * the `{number}` resolution at the passed coordinate. If this is `undefined`, + * the default {@link ol.proj#getPointResolution} function will be used. + */ + + /** * @classdesc * Projection definition class. One of these is created for each projection @@ -29,7 +52,7 @@ import {METERS_PER_UNIT} from '../proj/Units.js'; * namespace for proj4, use {@link ol.proj.setProj4}. * * @constructor - * @param {olx.ProjectionOptions} options Projection options. + * @param {module:ol/proj/Projection~Options} options Projection options. * @struct * @api */