ol.Attribution is a single-arg constructor

This commit is contained in:
Éric Lemoine
2013-08-30 16:46:51 +02:00
parent 29317c3316
commit 818894bb56
3 changed files with 17 additions and 10 deletions
+7
View File
@@ -1,3 +1,10 @@
/**
* @typedef {Object} ol.AttributionOptions
* @property {string} html HTML markup for this attribution.
* @property {Object.<string, Array.<ol.TileRange>>|undefined} tileRanges
* Tile ranges (FOR INTERNAL USE ONLY).
*/
/** /**
* @typedef {Object} ol.DeviceOrientationOptions * @typedef {Object} ol.DeviceOrientationOptions
* @property {boolean|undefined} tracking Tracking. * @property {boolean|undefined} tracking Tracking.
+1 -1
View File
@@ -1 +1 @@
@exportSymbol ol.Attribution @exportClass ol.Attribution ol.AttributionOptions
+9 -9
View File
@@ -11,31 +11,31 @@ goog.require('ol.TileRange');
* *
* source: new ol.source.OSM({ * source: new ol.source.OSM({
* attributions: [ * attributions: [
* new ol.Attribution( * new ol.Attribution({
* 'All maps &copy; ' + * html: 'All maps &copy; ' +
* '<a href="http://www.opencyclemap.org/">OpenCycleMap</a>'), * '<a href="http://www.opencyclemap.org/">OpenCycleMap</a>'
* }),
* ol.source.OSM.DATA_ATTRIBUTION * ol.source.OSM.DATA_ATTRIBUTION
* ], * ],
* .. * ..
* *
* @constructor * @constructor
* @param {string} html The markup to use for display of the attribution. * @param {ol.AttributionOptions} options Attribution options.
* @param {Object.<string, Array.<ol.TileRange>>=} opt_tileRanges Tile ranges
* (FOR INTERNAL USE ONLY).
*/ */
ol.Attribution = function(html, opt_tileRanges) { ol.Attribution = function(options) {
/** /**
* @private * @private
* @type {string} * @type {string}
*/ */
this.html_ = html; this.html_ = options.html;
/** /**
* @private * @private
* @type {Object.<string, Array.<ol.TileRange>>} * @type {Object.<string, Array.<ol.TileRange>>}
*/ */
this.tileRanges_ = opt_tileRanges || null; this.tileRanges_ = goog.isDef(options.tileRanges) ?
options.tileRanges : null;
}; };