Inline !goog.isDef() calls for properties

This commit is contained in:
Tim Schaub
2015-09-27 10:37:20 -06:00
parent e3951fa3c6
commit 36e336f406
6 changed files with 7 additions and 7 deletions

View File

@@ -134,7 +134,7 @@ ol.Geolocation.prototype.handleProjectionChanged_ = function() {
ol.Geolocation.prototype.handleTrackingChanged_ = function() { ol.Geolocation.prototype.handleTrackingChanged_ = function() {
if (ol.has.GEOLOCATION) { if (ol.has.GEOLOCATION) {
var tracking = this.getTracking(); var tracking = this.getTracking();
if (tracking && !goog.isDef(this.watchId_)) { if (tracking && this.watchId_ === undefined) {
this.watchId_ = goog.global.navigator.geolocation.watchPosition( this.watchId_ = goog.global.navigator.geolocation.watchPosition(
goog.bind(this.positionChange_, this), goog.bind(this.positionChange_, this),
goog.bind(this.positionError_, this), goog.bind(this.positionError_, this),

View File

@@ -1466,7 +1466,7 @@ ol.Map.createOptionsInternal = function(options) {
var values = {}; var values = {};
var logos = {}; var logos = {};
if (!goog.isDef(options.logo) || if (options.logo === undefined ||
(goog.isBoolean(options.logo) && options.logo)) { (goog.isBoolean(options.logo) && options.logo)) {
logos[ol.OL3_LOGO_URL] = ol.OL3_URL; logos[ol.OL3_LOGO_URL] = ol.OL3_URL;
} else { } else {

View File

@@ -149,7 +149,7 @@ ol.proj.Projection = function(options) {
!goog.isDef(projections[code])) { !goog.isDef(projections[code])) {
var def = proj4.defs(code); var def = proj4.defs(code);
if (def !== undefined) { if (def !== undefined) {
if (goog.isDef(def.axis) && !goog.isDef(options.axisOrientation)) { if (goog.isDef(def.axis) && options.axisOrientation === undefined) {
this.axisOrientation_ = def.axis; this.axisOrientation_ = def.axis;
} }
if (options.units === undefined) { if (options.units === undefined) {

View File

@@ -110,7 +110,7 @@ ol.renderer.webgl.Layer.prototype.bindFramebuffer =
var gl = this.mapRenderer.getGL(); var gl = this.mapRenderer.getGL();
if (!goog.isDef(this.framebufferDimension) || if (this.framebufferDimension === undefined ||
this.framebufferDimension != framebufferDimension) { this.framebufferDimension != framebufferDimension) {
frameState.postRenderFunctions.push( frameState.postRenderFunctions.push(

View File

@@ -194,7 +194,7 @@ ol.source.ImageWMS.prototype.getImage =
resolution = this.findNearestResolution(resolution); resolution = this.findNearestResolution(resolution);
if (pixelRatio != 1 && (!this.hidpi_ || !goog.isDef(this.serverType_))) { if (pixelRatio != 1 && (!this.hidpi_ || this.serverType_ === undefined)) {
pixelRatio = 1; pixelRatio = 1;
} }

View File

@@ -292,7 +292,7 @@ ol.source.TileWMS.prototype.getRequestUrl_ =
ol.source.TileWMS.prototype.getTilePixelSize = ol.source.TileWMS.prototype.getTilePixelSize =
function(z, pixelRatio, projection) { function(z, pixelRatio, projection) {
var tileSize = goog.base(this, 'getTilePixelSize', z, pixelRatio, projection); var tileSize = goog.base(this, 'getTilePixelSize', z, pixelRatio, projection);
if (pixelRatio == 1 || !this.hidpi_ || !goog.isDef(this.serverType_)) { if (pixelRatio == 1 || !this.hidpi_ || this.serverType_ === undefined) {
return tileSize; return tileSize;
} else { } else {
return ol.size.scale(tileSize, pixelRatio, this.tmpSize); return ol.size.scale(tileSize, pixelRatio, this.tmpSize);
@@ -373,7 +373,7 @@ ol.source.TileWMS.prototype.tileUrlFunction_ =
return undefined; return undefined;
} }
if (pixelRatio != 1 && (!this.hidpi_ || !goog.isDef(this.serverType_))) { if (pixelRatio != 1 && (!this.hidpi_ || this.serverType_ === undefined)) {
pixelRatio = 1; pixelRatio = 1;
} }