Add new constrainResolution option to olx.interaction.DefaultsOptions

This commit is contained in:
Frederic Junod
2017-04-11 09:08:28 +02:00
parent 55f8a2775e
commit 15e6fa454d
4 changed files with 51 additions and 2 deletions

View File

@@ -75,6 +75,7 @@ ol.interaction.defaults = function(opt_options) {
var pinchZoom = options.pinchZoom !== undefined ? options.pinchZoom : true;
if (pinchZoom) {
interactions.push(new ol.interaction.PinchZoom({
constrainResolution: options.constrainResolution,
duration: options.zoomDuration
}));
}
@@ -92,6 +93,7 @@ ol.interaction.defaults = function(opt_options) {
options.mouseWheelZoom : true;
if (mouseWheelZoom) {
interactions.push(new ol.interaction.MouseWheelZoom({
constrainResolution: options.constrainResolution,
duration: options.zoomDuration
}));
}