From 2869ed245c3d55310bc38f8ad514186cc01607f4 Mon Sep 17 00:00:00 2001 From: Marc Jansen Date: Mon, 22 Jul 2019 14:03:37 +0200 Subject: [PATCH] Improve documentation of getGetLegendGraphicUrl This also adresses one review comment by @jahow on #9762. --- src/ol/source/ImageWMS.js | 12 +++++++----- src/ol/source/TileWMS.js | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/ol/source/ImageWMS.js b/src/ol/source/ImageWMS.js index 3b85bc289b..9c333c93a1 100644 --- a/src/ol/source/ImageWMS.js +++ b/src/ol/source/ImageWMS.js @@ -192,11 +192,13 @@ class ImageWMS extends ImageSource { } /** - * Return the GetLegendGraphic URL for the passed resolution. - * Return `undefined` if the GetLegendGraphic URL cannot be constructed. - * @param {!number} resolution Resolution. If set to undefined `SCALE` - * will not be calculated. - * @param {!Object} params GetLegendGraphic params. Default `FORMAT` is + * Return the GetLegendGraphic URL, optionally optimized for the passed + * resolution and possibly including any passed specific parameters. Returns + * `undefined` if the GetLegendGraphic URL cannot be constructed. + * + * @param {number} [resolution] Resolution. If set to undefined, `SCALE` + * will not be calculated and included in URL. + * @param {Object} [params] GetLegendGraphic params. Default `FORMAT` is * `image/png`. `VERSION` should not be specified here. * @return {string|undefined} GetLegendGraphic URL. * @api diff --git a/src/ol/source/TileWMS.js b/src/ol/source/TileWMS.js index 66c29a2bfc..33ba9c0705 100644 --- a/src/ol/source/TileWMS.js +++ b/src/ol/source/TileWMS.js @@ -212,11 +212,13 @@ class TileWMS extends TileImage { } /** - * Return the GetLegendGraphic URL for the passed resolution. - * Return `undefined` if the GetLegendGraphic URL cannot be constructed. - * @param {!number} resolution Resolution. If set to undefined `SCALE` - * will not be calculated. - * @param {!Object} params GetLegendGraphic params. Default `FORMAT` is + * Return the GetLegendGraphic URL, optionally optimized for the passed + * resolution and possibly including any passed specific parameters. Returns + * `undefined` if the GetLegendGraphic URL cannot be constructed. + * + * @param {number} [resolution] Resolution. If set to undefined, `SCALE` + * will not be calculated and included in URL. + * @param {Object} [params] GetLegendGraphic params. Default `FORMAT` is * `image/png`. `VERSION` should not be specified here. * @return {string|undefined} GetLegendGraphic URL. * @api