Revert "Do not render in handleDownEvent"
This commit is contained in:
@@ -87,6 +87,7 @@ ol.interaction.DragPan.handleDragEvent_ = function(mapBrowserEvent) {
|
||||
ol.coordinate.rotate(center, viewState.rotation);
|
||||
ol.coordinate.add(center, viewState.center);
|
||||
center = view.constrainCenter(center);
|
||||
map.render();
|
||||
view.setCenter(center);
|
||||
}
|
||||
this.lastCentroid = centroid;
|
||||
@@ -119,6 +120,7 @@ ol.interaction.DragPan.handleUpEvent_ = function(mapBrowserEvent) {
|
||||
view.setCenter(dest);
|
||||
}
|
||||
view.setHint(ol.ViewHint.INTERACTING, -1);
|
||||
map.render();
|
||||
return false;
|
||||
} else {
|
||||
this.lastCentroid = null;
|
||||
@@ -141,6 +143,7 @@ ol.interaction.DragPan.handleDownEvent_ = function(mapBrowserEvent) {
|
||||
if (!this.handlingDownUpSequence) {
|
||||
view.setHint(ol.ViewHint.INTERACTING, 1);
|
||||
}
|
||||
map.render();
|
||||
if (this.kineticPreRenderFn_ &&
|
||||
map.removePreRenderFunction(this.kineticPreRenderFn_)) {
|
||||
view.setCenter(mapBrowserEvent.frameState.viewState.center);
|
||||
|
||||
@@ -88,6 +88,7 @@ ol.interaction.DragRotateAndZoom.handleDragEvent_ = function(mapBrowserEvent) {
|
||||
var theta = Math.atan2(delta.y, delta.x);
|
||||
var magnitude = delta.magnitude();
|
||||
var view = map.getView();
|
||||
map.render();
|
||||
if (this.lastAngle_ !== undefined) {
|
||||
var angleDelta = theta - this.lastAngle_;
|
||||
ol.interaction.Interaction.rotateWithoutConstraints(
|
||||
|
||||
@@ -72,6 +72,7 @@ ol.interaction.DragRotate.handleDragEvent_ = function(mapBrowserEvent) {
|
||||
var delta = theta - this.lastAngle_;
|
||||
var view = map.getView();
|
||||
var rotation = view.getRotation();
|
||||
map.render();
|
||||
ol.interaction.Interaction.rotateWithoutConstraints(
|
||||
map, view, rotation - delta);
|
||||
}
|
||||
@@ -115,6 +116,7 @@ ol.interaction.DragRotate.handleDownEvent_ = function(mapBrowserEvent) {
|
||||
if (browserEvent.isMouseActionButton() && this.condition_(mapBrowserEvent)) {
|
||||
var map = mapBrowserEvent.map;
|
||||
map.getView().setHint(ol.ViewHint.INTERACTING, 1);
|
||||
map.render();
|
||||
this.lastAngle_ = undefined;
|
||||
return true;
|
||||
} else {
|
||||
|
||||
@@ -74,6 +74,7 @@ ol.interaction.KeyboardZoom.handleEvent = function(mapBrowserEvent) {
|
||||
(charCode == '+'.charCodeAt(0) || charCode == '-'.charCodeAt(0))) {
|
||||
var map = mapBrowserEvent.map;
|
||||
var delta = (charCode == '+'.charCodeAt(0)) ? this.delta_ : -this.delta_;
|
||||
map.render();
|
||||
var view = map.getView();
|
||||
goog.asserts.assert(view, 'map must have view');
|
||||
ol.interaction.Interaction.zoomByDelta(
|
||||
|
||||
@@ -118,6 +118,7 @@ ol.interaction.MouseWheelZoom.prototype.doZoom_ = function(map) {
|
||||
var view = map.getView();
|
||||
goog.asserts.assert(view, 'map must have view');
|
||||
|
||||
map.render();
|
||||
ol.interaction.Interaction.zoomByDelta(map, view, -delta, this.lastAnchor_,
|
||||
this.duration_);
|
||||
|
||||
|
||||
@@ -115,6 +115,7 @@ ol.interaction.PinchRotate.handleDragEvent_ = function(mapBrowserEvent) {
|
||||
if (this.rotating_) {
|
||||
var view = map.getView();
|
||||
var rotation = view.getRotation();
|
||||
map.render();
|
||||
ol.interaction.Interaction.rotateWithoutConstraints(map, view,
|
||||
rotation + rotationDelta, this.anchor_);
|
||||
}
|
||||
@@ -160,6 +161,7 @@ ol.interaction.PinchRotate.handleDownEvent_ = function(mapBrowserEvent) {
|
||||
if (!this.handlingDownUpSequence) {
|
||||
map.getView().setHint(ol.ViewHint.INTERACTING, 1);
|
||||
}
|
||||
map.render();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
@@ -97,6 +97,7 @@ ol.interaction.PinchZoom.handleDragEvent_ = function(mapBrowserEvent) {
|
||||
this.anchor_ = map.getCoordinateFromPixel(centroid);
|
||||
|
||||
// scale, bypass the resolution constraint
|
||||
map.render();
|
||||
ol.interaction.Interaction.zoomWithoutConstraints(
|
||||
map, view, resolution * scaleDelta, this.anchor_);
|
||||
|
||||
@@ -143,6 +144,7 @@ ol.interaction.PinchZoom.handleDownEvent_ = function(mapBrowserEvent) {
|
||||
if (!this.handlingDownUpSequence) {
|
||||
map.getView().setHint(ol.ViewHint.INTERACTING, 1);
|
||||
}
|
||||
map.render();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user