Permalink
Browse files

Use an array to specify additional interactions

  • Loading branch information...
1 parent 363cb87 commit 38eaa9cfb2e002da856469e60d1c34267b489cfe @twpayne committed Mar 6, 2013
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/ol/interaction/defaults.js
@@ -18,10 +18,11 @@ goog.require('ol.interaction.condition');
/**
* @param {ol.interaction.DefaultOptions=} opt_options Options.
- * @param {...ol.interaction.Interaction} var_args Further interactions.
+ * @param {Array.<ol.interaction.Interaction>=} opt_interactions Additional
+ * interactions.
* @return {ol.Collection} Interactions.
*/
-ol.interaction.defaults = function(opt_options, var_args) {
+ol.interaction.defaults = function(opt_options, opt_interactions) {
var options = goog.isDef(opt_options) ? opt_options : {};
@@ -91,9 +92,8 @@ ol.interaction.defaults = function(opt_options, var_args) {
new ol.interaction.DragZoom(ol.interaction.condition.shiftKeyOnly));
}
- var i;
- for (i = 1; i < arguments.length; ++i) {
- interactions.push(arguments[i]);
+ if (goog.isDef(opt_interactions)) {
+ interactions.extend(opt_interactions);
}
return interactions;

0 comments on commit 38eaa9c

Please sign in to comment.