Module types for ol/proj

This commit is contained in:
Tim Schaub
2018-03-11 23:20:25 -06:00
parent ef70d71636
commit a743ec3989
49 changed files with 103 additions and 103 deletions

View File

@@ -7,7 +7,7 @@ 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
* @property {module:ol/proj/Units~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
@@ -15,7 +15,7 @@ import {METERS_PER_UNIT} from '../proj/Units.js';
* @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}
* If not provided, the `units` are used to get the meters per unit from the {@link module:ol/proj/Units~METERS_PER_UNIT}
* lookup table.
* @property {ol.Extent|undefined} worldExtent The world extent for the SRS.
* @property {(function(number, ol.Coordinate):number|undefined)} getPointResolution
@@ -34,7 +34,7 @@ import {METERS_PER_UNIT} from '../proj/Units.js';
* and options use {@link module:ol/proj~ProjectionLike} which means the simple string
* code will suffice.
*
* You can use {@link ol.proj.get} to retrieve the object for a particular
* You can use {@link module:ol/proj~get} to retrieve the object for a particular
* projection.
*
* The library includes definitions for `EPSG:4326` and `EPSG:3857`, together
@@ -49,7 +49,7 @@ import {METERS_PER_UNIT} from '../proj/Units.js';
*
* If you use proj4js, aliases can be added using `proj4.defs()`; see
* [documentation](https://github.com/proj4js/proj4js). To set an alternative
* namespace for proj4, use {@link ol.proj.setProj4}.
* namespace for proj4, use {@link module:ol/proj~setProj4}.
*
* @constructor
* @param {module:ol/proj/Projection~Options} options Projection options.
@@ -64,17 +64,17 @@ const Projection = function(options) {
this.code_ = options.code;
/**
* Units of projected coordinates. When set to `ol.proj.Units.TILE_PIXELS`, a
* Units of projected coordinates. When set to `TILE_PIXELS`, a
* `this.extent_` and `this.worldExtent_` must be configured properly for each
* tile.
* @private
* @type {ol.proj.Units}
* @type {module:ol/proj/Units~Units}
*/
this.units_ = /** @type {ol.proj.Units} */ (options.units);
this.units_ = /** @type {module:ol/proj/Units~Units} */ (options.units);
/**
* Validity extent of the projection in projected coordinates. For projections
* with `ol.proj.Units.TILE_PIXELS` units, this is the extent of the tile in
* with `TILE_PIXELS` units, this is the extent of the tile in
* tile pixel space.
* @private
* @type {module:ol/extent~Extent}
@@ -83,7 +83,7 @@ const Projection = function(options) {
/**
* Extent of the world in EPSG:4326. For projections with
* `ol.proj.Units.TILE_PIXELS` units, this is the extent of the tile in
* `TILE_PIXELS` units, this is the extent of the tile in
* projected coordinate space.
* @private
* @type {module:ol/extent~Extent}
@@ -160,7 +160,7 @@ Projection.prototype.getExtent = function() {
/**
* Get the units of this projection.
* @return {ol.proj.Units} Units.
* @return {module:ol/proj/Units~Units} Units.
* @api
*/
Projection.prototype.getUnits = function() {

View File

@@ -20,7 +20,7 @@ const Units = {
/**
* Meters per unit lookup table.
* @const
* @type {Object.<ol.proj.Units, number>}
* @type {Object.<module:ol/proj/Units~Units, number>}
* @api
*/
export const METERS_PER_UNIT = {};

View File

@@ -45,7 +45,7 @@ export const WORLD_EXTENT = [-180, -85, 180, 85];
* Projection object for web/spherical Mercator (EPSG:3857).
*
* @constructor
* @extends {ol.proj.Projection}
* @extends {module:ol/proj/Projection~Projection}
* @param {string} code Code.
*/
function EPSG3857Projection(code) {
@@ -67,7 +67,7 @@ inherits(EPSG3857Projection, Projection);
* Projections equal to EPSG:3857.
*
* @const
* @type {Array.<ol.proj.Projection>}
* @type {Array.<module:ol/proj/Projection~Projection>}
*/
export const PROJECTIONS = [
new EPSG3857Projection('EPSG:3857'),

View File

@@ -40,7 +40,7 @@ export const METERS_PER_UNIT = Math.PI * RADIUS / 180;
* OpenLayers treats EPSG:4326 as a pseudo-projection, with x,y coordinates.
*
* @constructor
* @extends {ol.proj.Projection}
* @extends {module:ol/proj/Projection~Projection}
* @param {string} code Code.
* @param {string=} opt_axisOrientation Axis orientation.
*/
@@ -62,7 +62,7 @@ inherits(EPSG4326Projection, Projection);
* Projections equal to EPSG:4326.
*
* @const
* @type {Array.<ol.proj.Projection>}
* @type {Array.<module:ol/proj/Projection~Projection>}
*/
export const PROJECTIONS = [
new EPSG4326Projection('CRS:84'),

View File

@@ -4,7 +4,7 @@
/**
* @type {Object.<string, ol.proj.Projection>}
* @type {Object.<string, module:ol/proj/Projection~Projection>}
*/
let cache = {};
@@ -20,7 +20,7 @@ export function clear() {
/**
* Get a cached projection by code.
* @param {string} code The code for the projection.
* @return {ol.proj.Projection} The projection (if cached).
* @return {module:ol/proj/Projection~Projection} The projection (if cached).
*/
export function get(code) {
return cache[code] || null;
@@ -30,7 +30,7 @@ export function get(code) {
/**
* Add a projection to the cache.
* @param {string} code The projection code.
* @param {ol.proj.Projection} projection The projection to cache.
* @param {module:ol/proj/Projection~Projection} projection The projection to cache.
*/
export function add(code, projection) {
cache[code] = projection;

View File

@@ -23,8 +23,8 @@ export function clear() {
* Registers a conversion function to convert coordinates from the source
* projection to the destination projection.
*
* @param {ol.proj.Projection} source Source.
* @param {ol.proj.Projection} destination Destination.
* @param {module:ol/proj/Projection~Projection} source Source.
* @param {module:ol/proj/Projection~Projection} destination Destination.
* @param {module:ol/proj~TransformFunction} transformFn Transform.
*/
export function add(source, destination, transformFn) {
@@ -42,8 +42,8 @@ export function add(source, destination, transformFn) {
* projection to the destination projection. This method is used to clean up
* cached transforms during testing.
*
* @param {ol.proj.Projection} source Source projection.
* @param {ol.proj.Projection} destination Destination projection.
* @param {module:ol/proj/Projection~Projection} source Source projection.
* @param {module:ol/proj/Projection~Projection} destination Destination projection.
* @return {module:ol/proj~TransformFunction} transformFn The unregistered transform.
*/
export function remove(source, destination) {