Remove goog.isDef from pinchzoominteraction

This commit is contained in:
Marc Jansen
2015-09-23 20:13:56 +02:00
committed by Tim Schaub
parent c7a98f19b7
commit 779811b52d

View File

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