diff --git a/src/objectliterals.jsdoc b/src/objectliterals.jsdoc index 8b94acbd1f..f4775394c6 100644 --- a/src/objectliterals.jsdoc +++ b/src/objectliterals.jsdoc @@ -1,3 +1,10 @@ +/** + * @typedef {Object} ol.AttributionOptions + * @property {string} html HTML markup for this attribution. + * @property {Object.>|undefined} tileRanges + * Tile ranges (FOR INTERNAL USE ONLY). + */ + /** * @typedef {Object} ol.DeviceOrientationOptions * @property {boolean|undefined} tracking Tracking. diff --git a/src/ol/attribution.exports b/src/ol/attribution.exports index 053c0abeae..27673d4985 100644 --- a/src/ol/attribution.exports +++ b/src/ol/attribution.exports @@ -1 +1 @@ -@exportSymbol ol.Attribution +@exportClass ol.Attribution ol.AttributionOptions diff --git a/src/ol/attribution.js b/src/ol/attribution.js index 81a88007be..95bc352e60 100644 --- a/src/ol/attribution.js +++ b/src/ol/attribution.js @@ -11,31 +11,31 @@ goog.require('ol.TileRange'); * * source: new ol.source.OSM({ * attributions: [ - * new ol.Attribution( - * 'All maps © ' + - * 'OpenCycleMap'), + * new ol.Attribution({ + * html: 'All maps © ' + + * 'OpenCycleMap' + * }), * ol.source.OSM.DATA_ATTRIBUTION * ], * .. * * @constructor - * @param {string} html The markup to use for display of the attribution. - * @param {Object.>=} opt_tileRanges Tile ranges - * (FOR INTERNAL USE ONLY). + * @param {ol.AttributionOptions} options Attribution options. */ -ol.Attribution = function(html, opt_tileRanges) { +ol.Attribution = function(options) { /** * @private * @type {string} */ - this.html_ = html; + this.html_ = options.html; /** * @private * @type {Object.>} */ - this.tileRanges_ = opt_tileRanges || null; + this.tileRanges_ = goog.isDef(options.tileRanges) ? + options.tileRanges : null; };