Remove goog.isDef from pinchzoominteraction
This commit is contained in:
@@ -3,6 +3,7 @@ goog.provide('ol.interaction.PinchZoom');
|
|||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.functions');
|
goog.require('goog.functions');
|
||||||
goog.require('goog.style');
|
goog.require('goog.style');
|
||||||
|
goog.require('ol');
|
||||||
goog.require('ol.Coordinate');
|
goog.require('ol.Coordinate');
|
||||||
goog.require('ol.ViewHint');
|
goog.require('ol.ViewHint');
|
||||||
goog.require('ol.interaction.Interaction');
|
goog.require('ol.interaction.Interaction');
|
||||||
@@ -28,7 +29,7 @@ ol.interaction.PinchZoom = function(opt_options) {
|
|||||||
handleUpEvent: ol.interaction.PinchZoom.handleUpEvent_
|
handleUpEvent: ol.interaction.PinchZoom.handleUpEvent_
|
||||||
});
|
});
|
||||||
|
|
||||||
var options = goog.isDef(opt_options) ? opt_options : {};
|
var options = opt_options ? opt_options : {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
@@ -40,7 +41,8 @@ ol.interaction.PinchZoom = function(opt_options) {
|
|||||||
* @private
|
* @private
|
||||||
* @type {number}
|
* @type {number}
|
||||||
*/
|
*/
|
||||||
this.duration_ = goog.isDef(options.duration) ? options.duration : 400;
|
this.duration_ = ol.isDef(options.duration) ?
|
||||||
|
/** @type {number} */ (options.duration) : 400;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
@@ -76,7 +78,7 @@ ol.interaction.PinchZoom.handleDragEvent_ = function(mapBrowserEvent) {
|
|||||||
// distance between touches
|
// distance between touches
|
||||||
var distance = Math.sqrt(dx * dx + dy * dy);
|
var distance = Math.sqrt(dx * dx + dy * dy);
|
||||||
|
|
||||||
if (goog.isDef(this.lastDistance_)) {
|
if (ol.isDef(this.lastDistance_)) {
|
||||||
scaleDelta = this.lastDistance_ / distance;
|
scaleDelta = this.lastDistance_ / distance;
|
||||||
}
|
}
|
||||||
this.lastDistance_ = distance;
|
this.lastDistance_ = distance;
|
||||||
|
|||||||
Reference in New Issue
Block a user