Merge pull request #5764 from bartvde/fewer-render-calls

Remove unnecessary map.render() calls
This commit is contained in:
Bart van den Eijnden
2016-08-23 10:36:15 +02:00
committed by GitHub
5 changed files with 0 additions and 8 deletions

View File

@@ -85,7 +85,6 @@ 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;
@@ -117,7 +116,6 @@ ol.interaction.DragPan.handleUpEvent_ = function(mapBrowserEvent) {
view.setCenter(dest);
}
view.setHint(ol.View.Hint.INTERACTING, -1);
map.render();
return false;
} else {
this.lastCentroid = null;
@@ -140,7 +138,6 @@ ol.interaction.DragPan.handleDownEvent_ = function(mapBrowserEvent) {
if (!this.handlingDownUpSequence) {
view.setHint(ol.View.Hint.INTERACTING, 1);
}
map.render();
if (this.kineticPreRenderFn_ &&
map.removePreRenderFunction(this.kineticPreRenderFn_)) {
view.setCenter(mapBrowserEvent.frameState.viewState.center);

View File

@@ -72,7 +72,6 @@ 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);
}
@@ -116,7 +115,6 @@ ol.interaction.DragRotate.handleDownEvent_ = function(mapBrowserEvent) {
this.condition_(mapBrowserEvent)) {
var map = mapBrowserEvent.map;
map.getView().setHint(ol.View.Hint.INTERACTING, 1);
map.render();
this.lastAngle_ = undefined;
return true;
} else {

View File

@@ -85,7 +85,6 @@ ol.interaction.DragRotateAndZoom.handleDragEvent_ = function(mapBrowserEvent) {
var theta = Math.atan2(deltaY, deltaX);
var magnitude = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
var view = map.getView();
map.render();
if (this.lastAngle_ !== undefined) {
var angleDelta = theta - this.lastAngle_;
ol.interaction.Interaction.rotateWithoutConstraints(

View File

@@ -73,7 +73,6 @@ 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();
ol.interaction.Interaction.zoomByDelta(
map, view, delta, undefined, this.duration_);

View File

@@ -132,7 +132,6 @@ ol.interaction.MouseWheelZoom.prototype.doZoom_ = function(map) {
var view = map.getView();
map.render();
ol.interaction.Interaction.zoomByDelta(map, view, -delta, this.lastAnchor_,
this.duration_);