diff --git a/externs/olx.js b/externs/olx.js index 3c58d0bba7..6fc1c709ef 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -680,7 +680,8 @@ 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. + * 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 */ diff --git a/src/ol/proj.js b/src/ol/proj.js index 3efe11601c..f62495d518 100644 --- a/src/ol/proj.js +++ b/src/ol/proj.js @@ -44,9 +44,14 @@ if (ol.ENABLE_PROJ4JS) { * Get the resolution of the point in degrees or distance units. * For projections with degrees as the unit this will simply return the * provided resolution. For other projections the point resolution is - * estimated by transforming the 'point' pixel to EPSG:4326, + * by default estimated by transforming the 'point' pixel to EPSG:4326, * measuring its width and height on the normal sphere, * and taking the average of the width and height. + * A custom function can be provided for a specific projection, either + * by setting the `getPointResolution` option in the + * {@link ol.proj.Projection} constructor or by using + * {@link ol.proj.Projection#setGetPointResolution} to change an existing + * projection object. * @param {ol.proj.Projection} projection The projection. * @param {number} resolution Nominal resolution in projection units. * @param {ol.Coordinate} point Point to find adjusted resolution at. diff --git a/src/ol/proj/projection.js b/src/ol/proj/projection.js index cef9f35f56..93c1854ec4 100644 --- a/src/ol/proj/projection.js +++ b/src/ol/proj/projection.js @@ -254,7 +254,8 @@ ol.proj.Projection.prototype.setWorldExtent = function(worldExtent) { /** - * Set the getPointResolution function for this projection. + * Set the getPointResolution function (see {@link ol.proj#getPointResolution} + * for this projection. * @param {function(number, ol.Coordinate):number} func Function * @api */