Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use an array to specify additional interactions

  • Loading branch information...
commit 38eaa9cfb2e002da856469e60d1c34267b489cfe 1 parent 363cb87
@twpayne authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/ol/interaction/defaults.js
View
10 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;
Please sign in to comment.
Something went wrong with that request. Please try again.