Merge pull request #6337 from tchandelle/drag-box-constraint

Constrain center in DragZoom interaction
This commit is contained in:
Andreas Hocevar
2017-01-09 15:43:00 +01:00
committed by GitHub

View File

@@ -74,9 +74,12 @@ ol.interaction.DragZoom.prototype.onBoxEnd = function() {
var resolution = view.constrainResolution(
view.getResolutionForExtent(extent, size));
var center = ol.extent.getCenter(extent);
center = view.constrainCenter(center);
view.animate({
resolution: resolution,
center: ol.extent.getCenter(extent),
center: center,
duration: this.duration_,
easing: ol.easing.easeOut
});