Module types for ol/proj
This commit is contained in:
2
examples/d3.js
vendored
2
examples/d3.js
vendored
@@ -37,7 +37,7 @@ d3.json('data/topojson/us.json', function(error, us) {
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {ol.Size} size Size.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @return {HTMLCanvasElement} A canvas element.
|
||||
*/
|
||||
const canvasFunction = function(extent, resolution, pixelRatio, size, projection) {
|
||||
|
||||
@@ -10,7 +10,7 @@ import TileWMS from '../src/ol/source/TileWMS.js';
|
||||
|
||||
// By default OpenLayers does not know about the EPSG:21781 (Swiss) projection.
|
||||
// So we create a projection instance for EPSG:21781 and pass it to
|
||||
// ol.proj.addProjection to make it available to the library for lookup by its
|
||||
// ol/proj~addProjection to make it available to the library for lookup by its
|
||||
// code.
|
||||
|
||||
const projection = new Projection({
|
||||
@@ -23,7 +23,7 @@ const projection = new Projection({
|
||||
addProjection(projection);
|
||||
|
||||
// We also declare EPSG:21781/EPSG:4326 transform functions. These functions
|
||||
// are necessary for the ScaleLine control and when calling ol.proj.transform
|
||||
// are necessary for the ScaleLine control and when calling ol/proj~transform
|
||||
// for setting the view's initial center (see below).
|
||||
|
||||
addCoordinateTransforms('EPSG:4326', projection,
|
||||
|
||||
@@ -254,7 +254,7 @@ oli.interaction.DragAndDropEvent.prototype.features;
|
||||
|
||||
|
||||
/**
|
||||
* @type {ol.proj.Projection|undefined}
|
||||
* @type {module:ol/proj/Projection~Projection|undefined}
|
||||
*/
|
||||
oli.interaction.DragAndDropEvent.prototype.projection;
|
||||
|
||||
|
||||
@@ -2885,7 +2885,7 @@ olx.source.ImageCanvasOptions.prototype.attributions;
|
||||
* Canvas function. The function returning the canvas element used by the source
|
||||
* as an image. The arguments passed to the function are: `{ol.Extent}` the
|
||||
* image extent, `{number}` the image resolution, `{number}` the device pixel
|
||||
* ratio, `{ol.Size}` the image size, and `{ol.proj.Projection}` the image
|
||||
* ratio, `{ol.Size}` the image size, and `{module:ol/proj/Projection~Projection}` the image
|
||||
* projection. The canvas returned by this function is cached by the source. If
|
||||
* the value returned by the function is later changed then
|
||||
* `dispatchChangeEvent` should be called on the source for the source to
|
||||
@@ -5385,7 +5385,7 @@ olx.tilegrid.XYZOptions.prototype.tileSize;
|
||||
|
||||
/**
|
||||
* @typedef {{center: ol.Coordinate,
|
||||
* projection: ol.proj.Projection,
|
||||
* projection: module:ol/proj/Projection~Projection,
|
||||
* resolution: number,
|
||||
* rotation: number,
|
||||
* zoom: number}}
|
||||
@@ -5401,7 +5401,7 @@ olx.ViewState.prototype.center;
|
||||
|
||||
|
||||
/**
|
||||
* @type {ol.proj.Projection}
|
||||
* @type {module:ol/proj/Projection~Projection}
|
||||
* @api
|
||||
*/
|
||||
olx.ViewState.prototype.projection;
|
||||
|
||||
@@ -755,7 +755,7 @@
|
||||
* @property {ol.CanvasFunctionType} canvasFunction Canvas function. The function returning the canvas element used by the source
|
||||
* as an image. The arguments passed to the function are: `{ol.Extent}` the
|
||||
* image extent, `{number}` the image resolution, `{number}` the device pixel
|
||||
* ratio, `{ol.Size}` the image size, and `{ol.proj.Projection}` the image
|
||||
* ratio, `{ol.Size}` the image size, and `{module:ol/proj/Projection~Projection}` the image
|
||||
* projection. The canvas returned by this function is cached by the source. If
|
||||
* the value returned by the function is later changed then
|
||||
* `dispatchChangeEvent` should be called on the source for the source to
|
||||
@@ -1453,7 +1453,7 @@
|
||||
/**
|
||||
* @typedef {Object} ViewState
|
||||
* @property {ol.Coordinate} center
|
||||
* @property {ol.proj.Projection} projection
|
||||
* @property {module:ol/proj/Projection~Projection} projection
|
||||
* @property {number} resolution
|
||||
* @property {number} rotation
|
||||
* @property {number} zoom The current zoom level.
|
||||
|
||||
@@ -89,7 +89,7 @@ const MousePosition = function(opt_options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.proj.Projection}
|
||||
* @type {module:ol/proj/Projection~Projection}
|
||||
*/
|
||||
this.mapProjection_ = null;
|
||||
|
||||
@@ -153,13 +153,13 @@ MousePosition.prototype.getCoordinateFormat = function() {
|
||||
|
||||
/**
|
||||
* Return the projection that is used to report the mouse position.
|
||||
* @return {ol.proj.Projection|undefined} The projection to report mouse
|
||||
* @return {module:ol/proj/Projection~Projection|undefined} The projection to report mouse
|
||||
* position in.
|
||||
* @observable
|
||||
* @api
|
||||
*/
|
||||
MousePosition.prototype.getProjection = function() {
|
||||
return /** @type {ol.proj.Projection|undefined} */ (this.get(PROJECTION));
|
||||
return /** @type {module:ol/proj/Projection~Projection|undefined} */ (this.get(PROJECTION));
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -500,7 +500,7 @@ EsriJSON.prototype.readGeometryFromObject = function(object, opt_options) {
|
||||
*
|
||||
* @function
|
||||
* @param {ArrayBuffer|Document|Node|Object|string} source Source.
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
* @return {module:ol/proj/Projection~Projection} Projection.
|
||||
* @api
|
||||
*/
|
||||
EsriJSON.prototype.readProjection;
|
||||
|
||||
@@ -64,13 +64,13 @@ const FeatureFormat = function() {
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {ol.proj.Projection}
|
||||
* @type {module:ol/proj/Projection~Projection}
|
||||
*/
|
||||
this.defaultDataProjection = null;
|
||||
|
||||
/**
|
||||
* @protected
|
||||
* @type {ol.proj.Projection}
|
||||
* @type {module:ol/proj/Projection~Projection}
|
||||
*/
|
||||
this.defaultFeatureProjection = null;
|
||||
|
||||
@@ -168,7 +168,7 @@ FeatureFormat.prototype.readGeometry = function(source, opt_options) {};
|
||||
*
|
||||
* @abstract
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
* @return {module:ol/proj/Projection~Projection} Projection.
|
||||
*/
|
||||
FeatureFormat.prototype.readProjection = function(source) {};
|
||||
|
||||
|
||||
@@ -705,7 +705,7 @@ GPX.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
*
|
||||
* @function
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
* @return {module:ol/proj/Projection~Projection} Projection.
|
||||
* @api
|
||||
*/
|
||||
GPX.prototype.readProjection;
|
||||
|
||||
@@ -438,7 +438,7 @@ GeoJSON.prototype.readGeometryFromObject = function(object, opt_options) {
|
||||
*
|
||||
* @function
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
* @return {module:ol/proj/Projection~Projection} Projection.
|
||||
* @api
|
||||
*/
|
||||
GeoJSON.prototype.readProjection;
|
||||
@@ -460,7 +460,7 @@ GeoJSON.prototype.readProjectionFromObject = function(object) {
|
||||
} else {
|
||||
projection = this.defaultDataProjection;
|
||||
}
|
||||
return /** @type {ol.proj.Projection} */ (projection);
|
||||
return /** @type {module:ol/proj/Projection~Projection} */ (projection);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ IGC.prototype.readFeaturesFromText = function(text, opt_options) {
|
||||
*
|
||||
* @function
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
* @return {module:ol/proj/Projection~Projection} Projection.
|
||||
* @api
|
||||
*/
|
||||
IGC.prototype.readProjection;
|
||||
|
||||
@@ -115,7 +115,7 @@ JSONFeature.prototype.readProjection = function(source) {
|
||||
* @abstract
|
||||
* @param {Object} object Object.
|
||||
* @protected
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
* @return {module:ol/proj/Projection~Projection} Projection.
|
||||
*/
|
||||
JSONFeature.prototype.readProjectionFromObject = function(object) {};
|
||||
|
||||
|
||||
@@ -2061,7 +2061,7 @@ KML.prototype.readRegionFromNode = function(node) {
|
||||
*
|
||||
* @function
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
* @return {module:ol/proj/Projection~Projection} Projection.
|
||||
* @api
|
||||
*/
|
||||
KML.prototype.readProjection;
|
||||
|
||||
@@ -54,7 +54,7 @@ const MVT = function(opt_options) {
|
||||
const options = opt_options ? opt_options : {};
|
||||
|
||||
/**
|
||||
* @type {ol.proj.Projection}
|
||||
* @type {module:ol/proj/Projection~Projection}
|
||||
*/
|
||||
this.defaultDataProjection = new Projection({
|
||||
code: '',
|
||||
|
||||
@@ -201,7 +201,7 @@ OSMXML.prototype.readFeaturesFromNode = function(node, opt_options) {
|
||||
*
|
||||
* @function
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
* @return {module:ol/proj/Projection~Projection} Projection.
|
||||
* @api
|
||||
*/
|
||||
OSMXML.prototype.readProjection;
|
||||
|
||||
@@ -342,7 +342,7 @@ Polyline.prototype.readGeometryFromText = function(text, opt_options) {
|
||||
*
|
||||
* @function
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
* @return {module:ol/proj/Projection~Projection} Projection.
|
||||
* @api
|
||||
*/
|
||||
Polyline.prototype.readProjection;
|
||||
|
||||
@@ -108,7 +108,7 @@ TextFeature.prototype.readProjection = function(source) {
|
||||
/**
|
||||
* @param {string} text Text.
|
||||
* @protected
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
* @return {module:ol/proj/Projection~Projection} Projection.
|
||||
*/
|
||||
TextFeature.prototype.readProjectionFromText = function(text) {
|
||||
return this.defaultDataProjection;
|
||||
|
||||
@@ -406,7 +406,7 @@ function transformVertex(vertex, scale, translate) {
|
||||
* Read the projection from a TopoJSON source.
|
||||
*
|
||||
* @param {Document|Node|Object|string} object Source.
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
* @return {module:ol/proj/Projection~Projection} Projection.
|
||||
* @override
|
||||
* @api
|
||||
*/
|
||||
|
||||
@@ -1069,7 +1069,7 @@ WFS.prototype.writeTransaction = function(inserts, updates, deletes, options) {
|
||||
*
|
||||
* @function
|
||||
* @param {Document|Node|Object|string} source Source.
|
||||
* @return {?ol.proj.Projection} Projection.
|
||||
* @return {?module:ol/proj/Projection~Projection} Projection.
|
||||
* @api
|
||||
*/
|
||||
WFS.prototype.readProjection;
|
||||
|
||||
@@ -187,7 +187,7 @@ XMLFeature.prototype.readProjection = function(source) {
|
||||
/**
|
||||
* @param {Document} doc Document.
|
||||
* @protected
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
* @return {module:ol/proj/Projection~Projection} Projection.
|
||||
*/
|
||||
XMLFeature.prototype.readProjectionFromDocument = function(doc) {
|
||||
return this.defaultDataProjection;
|
||||
@@ -197,7 +197,7 @@ XMLFeature.prototype.readProjectionFromDocument = function(doc) {
|
||||
/**
|
||||
* @param {Node} node Node.
|
||||
* @protected
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
* @return {module:ol/proj/Projection~Projection} Projection.
|
||||
*/
|
||||
XMLFeature.prototype.readProjectionFromNode = function(node) {
|
||||
return this.defaultDataProjection;
|
||||
|
||||
@@ -251,9 +251,9 @@ Circle.prototype.setRadius = function(radius) {
|
||||
* of the original circle.
|
||||
*
|
||||
* @param {module:ol/proj~ProjectionLike} source The current projection. Can be a
|
||||
* string identifier or a {@link ol.proj.Projection} object.
|
||||
* string identifier or a {@link module:ol/proj/Projection~Projection} object.
|
||||
* @param {module:ol/proj~ProjectionLike} destination The desired projection. Can be a
|
||||
* string identifier or a {@link ol.proj.Projection} object.
|
||||
* string identifier or a {@link module:ol/proj/Projection~Projection} object.
|
||||
* @return {module:ol/geom/Circle~Circle} This geometry. Note that original geometry is
|
||||
* modified in place.
|
||||
* @function
|
||||
|
||||
@@ -246,9 +246,9 @@ Geometry.prototype.translate = function(deltaX, deltaY) {};
|
||||
* then use this function on the clone.
|
||||
*
|
||||
* @param {module:ol/proj~ProjectionLike} source The current projection. Can be a
|
||||
* string identifier or a {@link ol.proj.Projection} object.
|
||||
* string identifier or a {@link module:ol/proj/Projection~Projection} object.
|
||||
* @param {module:ol/proj~ProjectionLike} destination The desired projection. Can be a
|
||||
* string identifier or a {@link ol.proj.Projection} object.
|
||||
* string identifier or a {@link module:ol/proj/Projection~Projection} object.
|
||||
* @return {module:ol/geom/Geometry~Geometry} This geometry. Note that original geometry is
|
||||
* modified in place.
|
||||
* @api
|
||||
|
||||
@@ -84,7 +84,7 @@ function line(interpolate, transform, squaredTolerance) {
|
||||
* @param {number} lat1 Latitude 1 in degrees.
|
||||
* @param {number} lon2 Longitude 2 in degrees.
|
||||
* @param {number} lat2 Latitude 2 in degrees.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
*/
|
||||
@@ -128,7 +128,7 @@ export function greatCircleArc(lon1, lat1, lon2, lat2, projection, squaredTolera
|
||||
* @param {number} lon Longitude.
|
||||
* @param {number} lat1 Latitude 1.
|
||||
* @param {number} lat2 Latitude 2.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
*/
|
||||
@@ -151,7 +151,7 @@ export function meridian(lon, lat1, lat2, projection, squaredTolerance) {
|
||||
* @param {number} lat Latitude.
|
||||
* @param {number} lon1 Longitude 1.
|
||||
* @param {number} lon2 Longitude 2.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @param {number} squaredTolerance Squared tolerance.
|
||||
* @return {Array.<number>} Flat coordinates.
|
||||
*/
|
||||
|
||||
@@ -36,7 +36,7 @@ const DragAndDropEventType = {
|
||||
* @param {ol.interaction.DragAndDropEventType} type Type.
|
||||
* @param {File} file File.
|
||||
* @param {Array.<ol.Feature>=} opt_features Features.
|
||||
* @param {ol.proj.Projection=} opt_projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection=} opt_projection Projection.
|
||||
*/
|
||||
const DragAndDropEvent = function(type, file, opt_features, opt_projection) {
|
||||
|
||||
@@ -58,7 +58,7 @@ const DragAndDropEvent = function(type, file, opt_features, opt_projection) {
|
||||
|
||||
/**
|
||||
* The feature projection.
|
||||
* @type {ol.proj.Projection|undefined}
|
||||
* @type {module:ol/proj/Projection~Projection|undefined}
|
||||
* @api
|
||||
*/
|
||||
this.projection = opt_projection;
|
||||
@@ -94,7 +94,7 @@ const DragAndDrop = function(opt_options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.proj.Projection}
|
||||
* @type {module:ol/proj/Projection~Projection}
|
||||
*/
|
||||
this.projection_ = options.projection ?
|
||||
getProjection(options.projection) : null;
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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 = {};
|
||||
|
||||
@@ -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'),
|
||||
|
||||
@@ -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'),
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -56,7 +56,7 @@ LayerRenderer.prototype.hasFeatureAtCoordinate = FALSE;
|
||||
/**
|
||||
* Create a function that adds loaded tiles to the tile lookup.
|
||||
* @param {ol.source.Tile} source Tile source.
|
||||
* @param {ol.proj.Projection} projection Projection of the tiles.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection of the tiles.
|
||||
* @param {Object.<number, Object.<string, ol.Tile>>} tiles Lookup of loaded
|
||||
* tiles by zoom level.
|
||||
* @return {function(number, ol.TileRange):boolean} A function that can be
|
||||
@@ -198,7 +198,7 @@ LayerRenderer.prototype.updateUsedTiles = function(usedTiles, tileSource, z, til
|
||||
* @param {ol.source.Tile} tileSource Tile source.
|
||||
* @param {ol.tilegrid.TileGrid} tileGrid Tile grid.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {number} currentZ Current Z.
|
||||
* @param {number} preload Load low resolution tiles up to 'preload' levels.
|
||||
|
||||
@@ -18,8 +18,8 @@ import Triangulation from '../reproj/Triangulation.js';
|
||||
*
|
||||
* @constructor
|
||||
* @extends {ol.ImageBase}
|
||||
* @param {ol.proj.Projection} sourceProj Source projection (of the data).
|
||||
* @param {ol.proj.Projection} targetProj Target projection.
|
||||
* @param {module:ol/proj/Projection~Projection} sourceProj Source projection (of the data).
|
||||
* @param {module:ol/proj/Projection~Projection} targetProj Target projection.
|
||||
* @param {module:ol/extent~Extent} targetExtent Target extent.
|
||||
* @param {number} targetResolution Target resolution.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
@@ -31,7 +31,7 @@ const ReprojImage = function(sourceProj, targetProj,
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.proj.Projection}
|
||||
* @type {module:ol/proj/Projection~Projection}
|
||||
*/
|
||||
this.targetProj_ = targetProj;
|
||||
|
||||
@@ -132,7 +132,7 @@ ReprojImage.prototype.getImage = function() {
|
||||
|
||||
|
||||
/**
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
* @return {module:ol/proj/Projection~Projection} Projection.
|
||||
*/
|
||||
ReprojImage.prototype.getProjection = function() {
|
||||
return this.targetProj_;
|
||||
|
||||
@@ -19,9 +19,9 @@ import Triangulation from '../reproj/Triangulation.js';
|
||||
*
|
||||
* @constructor
|
||||
* @extends {ol.Tile}
|
||||
* @param {ol.proj.Projection} sourceProj Source projection.
|
||||
* @param {module:ol/proj/Projection~Projection} sourceProj Source projection.
|
||||
* @param {ol.tilegrid.TileGrid} sourceTileGrid Source tile grid.
|
||||
* @param {ol.proj.Projection} targetProj Target projection.
|
||||
* @param {module:ol/proj/Projection~Projection} targetProj Target projection.
|
||||
* @param {ol.tilegrid.TileGrid} targetTileGrid Target tile grid.
|
||||
* @param {module:ol/tilecoord~TileCoord} tileCoord Coordinate of the tile.
|
||||
* @param {module:ol/tilecoord~TileCoord} wrappedTileCoord Coordinate of the tile wrapped in X.
|
||||
|
||||
@@ -33,8 +33,8 @@ const MAX_TRIANGLE_WIDTH = 0.25;
|
||||
* Class containing triangulation of the given target extent.
|
||||
* Used for determining source data and the reprojection itself.
|
||||
*
|
||||
* @param {ol.proj.Projection} sourceProj Source projection.
|
||||
* @param {ol.proj.Projection} targetProj Target projection.
|
||||
* @param {module:ol/proj/Projection~Projection} sourceProj Source projection.
|
||||
* @param {module:ol/proj/Projection~Projection} targetProj Target projection.
|
||||
* @param {module:ol/extent~Extent} targetExtent Target extent to triangulate.
|
||||
* @param {module:ol/extent~Extent} maxSourceExtent Maximal source extent that can be used.
|
||||
* @param {number} errorThreshold Acceptable error (in source units).
|
||||
@@ -44,13 +44,13 @@ const Triangulation = function(sourceProj, targetProj, targetExtent,
|
||||
maxSourceExtent, errorThreshold) {
|
||||
|
||||
/**
|
||||
* @type {ol.proj.Projection}
|
||||
* @type {module:ol/proj/Projection~Projection}
|
||||
* @private
|
||||
*/
|
||||
this.sourceProj_ = sourceProj;
|
||||
|
||||
/**
|
||||
* @type {ol.proj.Projection}
|
||||
* @type {module:ol/proj/Projection~Projection}
|
||||
* @private
|
||||
*/
|
||||
this.targetProj_ = targetProj;
|
||||
|
||||
@@ -151,7 +151,7 @@ BingMaps.prototype.handleImageryMetadataResponse = function(response) {
|
||||
/**
|
||||
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @return {string|undefined} Tile URL.
|
||||
*/
|
||||
function(tileCoord, pixelRatio, projection) {
|
||||
|
||||
@@ -139,7 +139,7 @@ ImageSource.prototype.findNearestResolution = function(resolution) {
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @return {ol.ImageBase} Single image.
|
||||
*/
|
||||
ImageSource.prototype.getImage = function(extent, resolution, pixelRatio, projection) {
|
||||
@@ -183,7 +183,7 @@ ImageSource.prototype.getImage = function(extent, resolution, pixelRatio, projec
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @return {ol.ImageBase} Single image.
|
||||
* @protected
|
||||
*/
|
||||
|
||||
@@ -195,7 +195,7 @@ ImageArcGISRest.prototype.getImageLoadFunction = function() {
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {module:ol/size~Size} size Size.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @param {Object} params Params.
|
||||
* @return {string} Request URL.
|
||||
* @private
|
||||
|
||||
@@ -203,7 +203,7 @@ ImageMapGuide.prototype.updateParams = function(params) {
|
||||
* @param {Object.<string, string|number>} params Request parameters.
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {module:ol/size~Size} size Size.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @return {string} The mapagent map image request URL.
|
||||
*/
|
||||
ImageMapGuide.prototype.getUrl = function(baseUrl, params, extent, size, projection) {
|
||||
|
||||
@@ -257,7 +257,7 @@ ImageWMS.prototype.getImageLoadFunction = function() {
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {module:ol/size~Size} size Size.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @param {Object} params Params.
|
||||
* @return {string} Request URL.
|
||||
* @private
|
||||
|
||||
@@ -224,7 +224,7 @@ RasterSource.prototype.setOperation = function(operation, opt_lib) {
|
||||
* Update the stored frame state.
|
||||
* @param {module:ol/extent~Extent} extent The view extent (in map units).
|
||||
* @param {number} resolution The view resolution.
|
||||
* @param {ol.proj.Projection} projection The view projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection The view projection.
|
||||
* @return {olx.FrameState} The updated frame state.
|
||||
* @private
|
||||
*/
|
||||
|
||||
@@ -28,7 +28,7 @@ const Source = function(options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {ol.proj.Projection}
|
||||
* @type {module:ol/proj/Projection~Projection}
|
||||
*/
|
||||
this.projection_ = getProjection(options.projection);
|
||||
|
||||
@@ -104,7 +104,7 @@ Source.prototype.getAttributions = function() {
|
||||
|
||||
/**
|
||||
* Get the projection of the source.
|
||||
* @return {ol.proj.Projection} Projection.
|
||||
* @return {module:ol/proj/Projection~Projection} Projection.
|
||||
* @api
|
||||
*/
|
||||
Source.prototype.getProjection = function() {
|
||||
|
||||
@@ -91,7 +91,7 @@ TileSource.prototype.canExpireCache = function() {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @param {Object.<string, ol.TileRange>} usedTiles Used tiles.
|
||||
*/
|
||||
TileSource.prototype.expireCache = function(projection, usedTiles) {
|
||||
@@ -103,7 +103,7 @@ TileSource.prototype.expireCache = function(projection, usedTiles) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @param {number} z Zoom level.
|
||||
* @param {ol.TileRange} tileRange Tile range.
|
||||
* @param {function(ol.Tile):(boolean|undefined)} callback Called with each
|
||||
@@ -140,7 +140,7 @@ TileSource.prototype.forEachLoadedTile = function(projection, z, tileRange, call
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @return {number} Gutter.
|
||||
*/
|
||||
TileSource.prototype.getGutter = function(projection) {
|
||||
@@ -172,7 +172,7 @@ TileSource.prototype.setKey = function(key) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @return {boolean} Opaque.
|
||||
*/
|
||||
TileSource.prototype.getOpaque = function(projection) {
|
||||
@@ -194,7 +194,7 @@ TileSource.prototype.getResolutions = function() {
|
||||
* @param {number} x Tile coordinate x.
|
||||
* @param {number} y Tile coordinate y.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @return {!ol.Tile} Tile.
|
||||
*/
|
||||
TileSource.prototype.getTile = function(z, x, y, pixelRatio, projection) {};
|
||||
@@ -211,7 +211,7 @@ TileSource.prototype.getTileGrid = function() {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @return {!ol.tilegrid.TileGrid} Tile grid.
|
||||
*/
|
||||
TileSource.prototype.getTileGridForProjection = function(projection) {
|
||||
@@ -224,7 +224,7 @@ TileSource.prototype.getTileGridForProjection = function(projection) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @return {ol.TileCache} Tile cache.
|
||||
* @protected
|
||||
*/
|
||||
@@ -253,7 +253,7 @@ TileSource.prototype.getTilePixelRatio = function(pixelRatio) {
|
||||
/**
|
||||
* @param {number} z Z.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @return {module:ol/size~Size} Tile size.
|
||||
*/
|
||||
TileSource.prototype.getTilePixelSize = function(z, pixelRatio, projection) {
|
||||
@@ -273,7 +273,7 @@ TileSource.prototype.getTilePixelSize = function(z, pixelRatio, projection) {
|
||||
* is outside the resolution and extent range of the tile grid, `null` will be
|
||||
* returned.
|
||||
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
|
||||
* @param {ol.proj.Projection=} opt_projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection=} opt_projection Projection.
|
||||
* @return {module:ol/tilecoord~TileCoord} Tile coordinate to be passed to the tileUrlFunction or
|
||||
* null if no tile URL should be created for the passed `tileCoord`.
|
||||
*/
|
||||
@@ -302,7 +302,7 @@ TileSource.prototype.refresh = function() {
|
||||
* @param {number} z Tile coordinate z.
|
||||
* @param {number} x Tile coordinate x.
|
||||
* @param {number} y Tile coordinate y.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
*/
|
||||
TileSource.prototype.useTile = UNDEFINED;
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ TileArcGISRest.prototype.getParams = function() {
|
||||
* @param {module:ol/size~Size} tileSize Tile size.
|
||||
* @param {module:ol/extent~Extent} tileExtent Tile extent.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @param {Object} params Params.
|
||||
* @return {string|undefined} Request URL.
|
||||
* @private
|
||||
|
||||
@@ -204,7 +204,7 @@ TileImage.prototype.getTileCacheForProjection = function(projection) {
|
||||
* @param {number} x Tile coordinate x.
|
||||
* @param {number} y Tile coordinate y.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @param {string} key The key set on the tile.
|
||||
* @return {!ol.Tile} Tile.
|
||||
* @private
|
||||
@@ -233,7 +233,7 @@ TileImage.prototype.createTile_ = function(z, x, y, pixelRatio, projection, key)
|
||||
* @inheritDoc
|
||||
*/
|
||||
TileImage.prototype.getTile = function(z, x, y, pixelRatio, projection) {
|
||||
const sourceProjection = /** @type {!ol.proj.Projection} */ (this.getProjection());
|
||||
const sourceProjection = /** @type {!module:ol/proj/Projection~Projection} */ (this.getProjection());
|
||||
if (!ENABLE_RASTER_REPROJECTION ||
|
||||
!sourceProjection || !projection || equivalent(sourceProjection, projection)) {
|
||||
return this.getTileInternal(z, x, y, pixelRatio, sourceProjection || projection);
|
||||
@@ -282,7 +282,7 @@ TileImage.prototype.getTile = function(z, x, y, pixelRatio, projection) {
|
||||
* @param {number} x Tile coordinate x.
|
||||
* @param {number} y Tile coordinate y.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {!ol.proj.Projection} projection Projection.
|
||||
* @param {!module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @return {!ol.Tile} Tile.
|
||||
* @protected
|
||||
*/
|
||||
|
||||
@@ -185,7 +185,7 @@ TileWMS.prototype.getParams = function() {
|
||||
* @param {module:ol/size~Size} tileSize Tile size.
|
||||
* @param {module:ol/extent~Extent} tileExtent Tile extent.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @param {Object} params Params.
|
||||
* @return {string|undefined} Request URL.
|
||||
* @private
|
||||
|
||||
@@ -752,7 +752,7 @@ VectorSource.prototype.isEmpty = function() {
|
||||
/**
|
||||
* @param {module:ol/extent~Extent} extent Extent.
|
||||
* @param {number} resolution Resolution.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
*/
|
||||
VectorSource.prototype.loadFeatures = function(extent, resolution, projection) {
|
||||
const loadedExtentsRtree = this.loadedExtentsRtree_;
|
||||
|
||||
@@ -123,7 +123,7 @@ const WMTS = function(options) {
|
||||
/**
|
||||
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile coordinate.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @return {string|undefined} Tile URL.
|
||||
*/
|
||||
function(tileCoord, pixelRatio, projection) {
|
||||
|
||||
@@ -169,7 +169,7 @@ const Zoomify = function(opt_options) {
|
||||
/**
|
||||
* @param {module:ol/tilecoord~TileCoord} tileCoord Tile Coordinate.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {ol.proj.Projection} projection Projection.
|
||||
* @param {module:ol/proj/Projection~Projection} projection Projection.
|
||||
* @return {string|undefined} Tile URL.
|
||||
*/
|
||||
function(tileCoord, pixelRatio, projection) {
|
||||
|
||||
@@ -80,12 +80,12 @@ ol.CanvasFillState;
|
||||
* used by the source as an image. The arguments passed to the function are:
|
||||
* {@link module:ol/extent~Extent} the image extent, `{number}` the image resolution,
|
||||
* `{number}` the device pixel ratio, {@link module:ol/size~Size} the image size, and
|
||||
* {@link ol.proj.Projection} the image projection. The canvas returned by
|
||||
* {@link module:ol/proj/Projection~Projection} the image projection. The canvas returned by
|
||||
* this function is cached by the source. The this keyword inside the function
|
||||
* references the {@link ol.source.ImageCanvas}.
|
||||
*
|
||||
* @typedef {function(this:ol.source.ImageCanvas, module:ol/extent~Extent, number,
|
||||
* number, module:ol/size~Size, ol.proj.Projection): HTMLCanvasElement}
|
||||
* number, module:ol/size~Size, module:ol/proj/Projection~Projection): HTMLCanvasElement}
|
||||
*/
|
||||
ol.CanvasFunctionType;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user