Toward natural JavaScript syntax

This commit is contained in:
Tim Schaub
2015-09-25 12:16:42 -06:00
parent d610b206f7
commit 0927c55b3c
40 changed files with 146 additions and 188 deletions
+2 -3
View File
@@ -41,8 +41,7 @@ ol.interaction.PinchZoom = function(opt_options) {
* @private
* @type {number}
*/
this.duration_ = ol.isDef(options.duration) ?
/** @type {number} */ (options.duration) : 400;
this.duration_ = options.duration !== undefined ? options.duration : 400;
/**
* @private
@@ -78,7 +77,7 @@ ol.interaction.PinchZoom.handleDragEvent_ = function(mapBrowserEvent) {
// distance between touches
var distance = Math.sqrt(dx * dx + dy * dy);
if (ol.isDef(this.lastDistance_)) {
if (this.lastDistance_ !== undefined) {
scaleDelta = this.lastDistance_ / distance;
}
this.lastDistance_ = distance;