'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _collection = require('./collection.js');

var _collection2 = _interopRequireDefault(_collection);

var _attribution = require('./control/attribution.js');

var _attribution2 = _interopRequireDefault(_attribution);

var _rotate = require('./control/rotate.js');

var _rotate2 = _interopRequireDefault(_rotate);

var _zoom = require('./control/zoom.js');

var _zoom2 = _interopRequireDefault(_zoom);

function _interopRequireDefault(obj) {
  return obj && obj.__esModule ? obj : { default: obj };
}

var _ol_control_ = {};

/**
 * Set of controls included in maps by default. Unless configured otherwise,
 * this returns a collection containing an instance of each of the following
 * controls:
 * * {@link ol.control.Zoom}
 * * {@link ol.control.Rotate}
 * * {@link ol.control.Attribution}
 *
 * @param {olx.control.DefaultsOptions=} opt_options Defaults options.
 * @return {ol.Collection.<ol.control.Control>} Controls.
 * @api
 */
_ol_control_.defaults = function (opt_options) {

  var options = opt_options ? opt_options : {};

  var controls = new _collection2.default();

  var zoomControl = options.zoom !== undefined ? options.zoom : true;
  if (zoomControl) {
    controls.push(new _zoom2.default(options.zoomOptions));
  }

  var rotateControl = options.rotate !== undefined ? options.rotate : true;
  if (rotateControl) {
    controls.push(new _rotate2.default(options.rotateOptions));
  }

  var attributionControl = options.attribution !== undefined ? options.attribution : true;
  if (attributionControl) {
    controls.push(new _attribution2.default(options.attributionOptions));
  }

  return controls;
};
exports.default = _ol_control_;
module.exports = exports['default'];