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

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
* @property {boolean|undefined} tracking Tracking.

View File

@@ -1 +1 @@
@exportSymbol ol.Attribution
@exportClass ol.Attribution ol.AttributionOptions

View File

@@ -11,31 +11,31 @@ goog.require('ol.TileRange');
*
* source: new ol.source.OSM({
* attributions: [
* new ol.Attribution(
* 'All maps &copy; ' +
* '<a href="http://www.opencyclemap.org/">OpenCycleMap</a>'),
* new ol.Attribution({
* html: 'All maps &copy; ' +
* '<a href="http://www.opencyclemap.org/">OpenCycleMap</a>'
* }),
* ol.source.OSM.DATA_ATTRIBUTION
* ],
* ..
*
* @constructor
* @param {string} html The markup to use for display of the attribution.
* @param {Object.<string, Array.<ol.TileRange>>=} 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.<string, Array.<ol.TileRange>>}
*/
this.tileRanges_ = opt_tileRanges || null;
this.tileRanges_ = goog.isDef(options.tileRanges) ?
options.tileRanges : null;
};