Remove goog.isDef from dragrotateinteraction
This commit is contained in:
@@ -23,7 +23,7 @@ goog.require('ol.interaction.Pointer');
|
||||
*/
|
||||
ol.interaction.DragRotate = function(opt_options) {
|
||||
|
||||
var options = goog.isDef(opt_options) ? opt_options : {};
|
||||
var options = opt_options ? opt_options : {};
|
||||
|
||||
goog.base(this, {
|
||||
handleDownEvent: ol.interaction.DragRotate.handleDownEvent_,
|
||||
@@ -35,7 +35,7 @@ ol.interaction.DragRotate = function(opt_options) {
|
||||
* @private
|
||||
* @type {ol.events.ConditionType}
|
||||
*/
|
||||
this.condition_ = goog.isDef(options.condition) ?
|
||||
this.condition_ = options.condition ?
|
||||
options.condition : ol.events.condition.altShiftKeysOnly;
|
||||
|
||||
/**
|
||||
@@ -48,7 +48,7 @@ ol.interaction.DragRotate = function(opt_options) {
|
||||
* @private
|
||||
* @type {number}
|
||||
*/
|
||||
this.duration_ = goog.isDef(options.duration) ? options.duration : 250;
|
||||
this.duration_ = options.duration ? options.duration : 250;
|
||||
};
|
||||
goog.inherits(ol.interaction.DragRotate, ol.interaction.Pointer);
|
||||
|
||||
@@ -68,7 +68,7 @@ ol.interaction.DragRotate.handleDragEvent_ = function(mapBrowserEvent) {
|
||||
var offset = mapBrowserEvent.pixel;
|
||||
var theta =
|
||||
Math.atan2(size[1] / 2 - offset[1], offset[0] - size[0] / 2);
|
||||
if (goog.isDef(this.lastAngle_)) {
|
||||
if (this.lastAngle_ !== undefined) {
|
||||
var delta = theta - this.lastAngle_;
|
||||
var view = map.getView();
|
||||
var rotation = view.getRotation();
|
||||
|
||||
Reference in New Issue
Block a user