view.getRotation default value already set to 0.
This commit is contained in:
@@ -79,7 +79,7 @@ ol.interaction.DragRotateAndZoom.prototype.handleDragStart =
|
|||||||
browserEvent.offsetX - size.width / 2,
|
browserEvent.offsetX - size.width / 2,
|
||||||
size.height / 2 - browserEvent.offsetY);
|
size.height / 2 - browserEvent.offsetY);
|
||||||
var theta = Math.atan2(delta.y, delta.x);
|
var theta = Math.atan2(delta.y, delta.x);
|
||||||
this.startRotation_ = (view.getRotation() || 0) + theta;
|
this.startRotation_ = view.getRotation() + theta;
|
||||||
this.startRatio_ = resolution / delta.magnitude();
|
this.startRatio_ = resolution / delta.magnitude();
|
||||||
map.requestRenderFrame();
|
map.requestRenderFrame();
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ ol.interaction.DragRotate.prototype.handleDragStart =
|
|||||||
var theta = Math.atan2(
|
var theta = Math.atan2(
|
||||||
size.height / 2 - offset.y,
|
size.height / 2 - offset.y,
|
||||||
offset.x - size.width / 2);
|
offset.x - size.width / 2);
|
||||||
this.startRotation_ = (view.getRotation() || 0) + theta;
|
this.startRotation_ = view.getRotation() + theta;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user