Remove remaining goog.isDef() calls
This commit is contained in:
@@ -297,7 +297,7 @@ ol.Overlay.prototype.handleOffsetChanged = function() {
|
||||
*/
|
||||
ol.Overlay.prototype.handlePositionChanged = function() {
|
||||
this.updatePixelPosition();
|
||||
if (goog.isDef(this.get(ol.OverlayProperty.POSITION)) && this.autoPan) {
|
||||
if (this.get(ol.OverlayProperty.POSITION) !== undefined && this.autoPan) {
|
||||
this.panIntoView_();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -653,7 +653,7 @@ ol.proj.get = function(projectionLike) {
|
||||
var code = projectionLike;
|
||||
projection = ol.proj.projections_[code];
|
||||
if (ol.ENABLE_PROJ4JS && projection === undefined &&
|
||||
typeof proj4 == 'function' && goog.isDef(proj4.defs(code))) {
|
||||
typeof proj4 == 'function' && proj4.defs(code) !== undefined) {
|
||||
projection = new ol.proj.Projection({code: code});
|
||||
ol.proj.addProjection(projection);
|
||||
}
|
||||
|
||||
@@ -275,10 +275,14 @@ ol.renderer.canvas.VectorLayer.prototype.prepareFrame =
|
||||
*/
|
||||
function(feature) {
|
||||
var styles;
|
||||
if (goog.isDef(feature.getStyleFunction())) {
|
||||
styles = feature.getStyleFunction().call(feature, resolution);
|
||||
} else if (goog.isDef(vectorLayer.getStyleFunction())) {
|
||||
styles = vectorLayer.getStyleFunction()(feature, resolution);
|
||||
var styleFunction = feature.getStyleFunction();
|
||||
if (styleFunction) {
|
||||
styles = styleFunction.call(feature, resolution);
|
||||
} else {
|
||||
styleFunction = vectorLayer.getStyleFunction();
|
||||
if (styleFunction) {
|
||||
styles = styleFunction(feature, resolution);
|
||||
}
|
||||
}
|
||||
if (goog.isDefAndNotNull(styles)) {
|
||||
var dirty = this.renderFeature(
|
||||
|
||||
@@ -283,10 +283,14 @@ ol.renderer.dom.VectorLayer.prototype.prepareFrame =
|
||||
*/
|
||||
function(feature) {
|
||||
var styles;
|
||||
if (goog.isDef(feature.getStyleFunction())) {
|
||||
styles = feature.getStyleFunction().call(feature, resolution);
|
||||
} else if (goog.isDef(vectorLayer.getStyleFunction())) {
|
||||
styles = vectorLayer.getStyleFunction()(feature, resolution);
|
||||
var styleFunction = feature.getStyleFunction();
|
||||
if (styleFunction) {
|
||||
styles = styleFunction.call(feature, resolution);
|
||||
} else {
|
||||
styleFunction = vectorLayer.getStyleFunction();
|
||||
if (styleFunction) {
|
||||
styles = styleFunction(feature, resolution);
|
||||
}
|
||||
}
|
||||
if (goog.isDefAndNotNull(styles)) {
|
||||
var dirty = this.renderFeature(
|
||||
|
||||
@@ -256,10 +256,14 @@ ol.renderer.webgl.VectorLayer.prototype.prepareFrame =
|
||||
*/
|
||||
function(feature) {
|
||||
var styles;
|
||||
if (goog.isDef(feature.getStyleFunction())) {
|
||||
styles = feature.getStyleFunction().call(feature, resolution);
|
||||
} else if (goog.isDef(vectorLayer.getStyleFunction())) {
|
||||
styles = vectorLayer.getStyleFunction()(feature, resolution);
|
||||
var styleFunction = feature.getStyleFunction();
|
||||
if (styleFunction) {
|
||||
styles = styleFunction.call(feature, resolution);
|
||||
} else {
|
||||
styleFunction = vectorLayer.getStyleFunction();
|
||||
if (styleFunction) {
|
||||
styles = styleFunction(feature, resolution);
|
||||
}
|
||||
}
|
||||
if (goog.isDefAndNotNull(styles)) {
|
||||
var dirty = this.renderFeature(
|
||||
|
||||
@@ -259,9 +259,10 @@ ol.source.ImageVector.prototype.handleSourceChange_ = function() {
|
||||
ol.source.ImageVector.prototype.renderFeature_ =
|
||||
function(feature, resolution, pixelRatio, replayGroup) {
|
||||
var styles;
|
||||
if (goog.isDef(feature.getStyleFunction())) {
|
||||
styles = feature.getStyleFunction().call(feature, resolution);
|
||||
} else if (this.styleFunction_ !== undefined) {
|
||||
var styleFunction = feature.getStyleFunction();
|
||||
if (styleFunction) {
|
||||
styles = styleFunction.call(feature, resolution);
|
||||
} else if (this.styleFunction_) {
|
||||
styles = this.styleFunction_(feature, resolution);
|
||||
}
|
||||
if (!goog.isDefAndNotNull(styles)) {
|
||||
|
||||
@@ -553,7 +553,7 @@ ol.View.prototype.centerOn = function(coordinate, size, position) {
|
||||
*/
|
||||
ol.View.prototype.isDef = function() {
|
||||
return goog.isDefAndNotNull(this.getCenter()) &&
|
||||
goog.isDef(this.getResolution());
|
||||
this.getResolution() !== undefined;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user