'use strict';

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

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

var _collection2 = _interopRequireDefault(_collection);

var _kinetic = require('./kinetic.js');

var _kinetic2 = _interopRequireDefault(_kinetic);

var _doubleclickzoom = require('./interaction/doubleclickzoom.js');

var _doubleclickzoom2 = _interopRequireDefault(_doubleclickzoom);

var _dragpan = require('./interaction/dragpan.js');

var _dragpan2 = _interopRequireDefault(_dragpan);

var _dragrotate = require('./interaction/dragrotate.js');

var _dragrotate2 = _interopRequireDefault(_dragrotate);

var _dragzoom = require('./interaction/dragzoom.js');

var _dragzoom2 = _interopRequireDefault(_dragzoom);

var _keyboardpan = require('./interaction/keyboardpan.js');

var _keyboardpan2 = _interopRequireDefault(_keyboardpan);

var _keyboardzoom = require('./interaction/keyboardzoom.js');

var _keyboardzoom2 = _interopRequireDefault(_keyboardzoom);

var _mousewheelzoom = require('./interaction/mousewheelzoom.js');

var _mousewheelzoom2 = _interopRequireDefault(_mousewheelzoom);

var _pinchrotate = require('./interaction/pinchrotate.js');

var _pinchrotate2 = _interopRequireDefault(_pinchrotate);

var _pinchzoom = require('./interaction/pinchzoom.js');

var _pinchzoom2 = _interopRequireDefault(_pinchzoom);

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

var _ol_interaction_ = {};

/**
 * Set of interactions included in maps by default. Specific interactions can be
 * excluded by setting the appropriate option to false in the constructor
 * options, but the order of the interactions is fixed.  If you want to specify
 * a different order for interactions, you will need to create your own
 * {@link ol.interaction.Interaction} instances and insert them into a
 * {@link ol.Collection} in the order you want before creating your
 * {@link ol.Map} instance. The default set of interactions, in sequence, is:
 * * {@link ol.interaction.DragRotate}
 * * {@link ol.interaction.DoubleClickZoom}
 * * {@link ol.interaction.DragPan}
 * * {@link ol.interaction.PinchRotate}
 * * {@link ol.interaction.PinchZoom}
 * * {@link ol.interaction.KeyboardPan}
 * * {@link ol.interaction.KeyboardZoom}
 * * {@link ol.interaction.MouseWheelZoom}
 * * {@link ol.interaction.DragZoom}
 *
 * @param {olx.interaction.DefaultsOptions=} opt_options Defaults options.
 * @return {ol.Collection.<ol.interaction.Interaction>} A collection of
 * interactions to be used with the ol.Map constructor's interactions option.
 * @api
 */
_ol_interaction_.defaults = function (opt_options) {

  var options = opt_options ? opt_options : {};

  var interactions = new _collection2.default();

  var kinetic = new _kinetic2.default(-0.005, 0.05, 100);

  var altShiftDragRotate = options.altShiftDragRotate !== undefined ? options.altShiftDragRotate : true;
  if (altShiftDragRotate) {
    interactions.push(new _dragrotate2.default());
  }

  var doubleClickZoom = options.doubleClickZoom !== undefined ? options.doubleClickZoom : true;
  if (doubleClickZoom) {
    interactions.push(new _doubleclickzoom2.default({
      delta: options.zoomDelta,
      duration: options.zoomDuration
    }));
  }

  var dragPan = options.dragPan !== undefined ? options.dragPan : true;
  if (dragPan) {
    interactions.push(new _dragpan2.default({
      kinetic: kinetic
    }));
  }

  var pinchRotate = options.pinchRotate !== undefined ? options.pinchRotate : true;
  if (pinchRotate) {
    interactions.push(new _pinchrotate2.default());
  }

  var pinchZoom = options.pinchZoom !== undefined ? options.pinchZoom : true;
  if (pinchZoom) {
    interactions.push(new _pinchzoom2.default({
      constrainResolution: options.constrainResolution,
      duration: options.zoomDuration
    }));
  }

  var keyboard = options.keyboard !== undefined ? options.keyboard : true;
  if (keyboard) {
    interactions.push(new _keyboardpan2.default());
    interactions.push(new _keyboardzoom2.default({
      delta: options.zoomDelta,
      duration: options.zoomDuration
    }));
  }

  var mouseWheelZoom = options.mouseWheelZoom !== undefined ? options.mouseWheelZoom : true;
  if (mouseWheelZoom) {
    interactions.push(new _mousewheelzoom2.default({
      constrainResolution: options.constrainResolution,
      duration: options.zoomDuration
    }));
  }

  var shiftDragZoom = options.shiftDragZoom !== undefined ? options.shiftDragZoom : true;
  if (shiftDragZoom) {
    interactions.push(new _dragzoom2.default({
      duration: options.zoomDuration
    }));
  }

  return interactions;
};
exports.default = _ol_interaction_;
module.exports = exports['default'];