Replace goog.isDefAndNotNull() with truthy checks
This commit is contained in:
@@ -180,7 +180,7 @@ ol.format.GMLBase.prototype.readGeometryElement = function(node, objectStack) {
|
||||
context['srsName'] = node.firstElementChild.getAttribute('srsName');
|
||||
var geometry = ol.xml.pushParseAndPop(/** @type {ol.geom.Geometry} */(null),
|
||||
this.GEOMETRY_PARSERS_, node, objectStack, this);
|
||||
if (goog.isDefAndNotNull(geometry)) {
|
||||
if (geometry) {
|
||||
return /** @type {ol.geom.Geometry} */ (
|
||||
ol.format.Feature.transformWithOptions(geometry, false, context));
|
||||
} else {
|
||||
@@ -243,7 +243,7 @@ ol.format.GMLBase.prototype.readPoint = function(node, objectStack) {
|
||||
goog.asserts.assert(node.localName == 'Point', 'localName should be Point');
|
||||
var flatCoordinates =
|
||||
this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||
if (goog.isDefAndNotNull(flatCoordinates)) {
|
||||
if (flatCoordinates) {
|
||||
var point = new ol.geom.Point(null);
|
||||
goog.asserts.assert(flatCoordinates.length == 3,
|
||||
'flatCoordinates should have a length of 3');
|
||||
@@ -382,7 +382,7 @@ ol.format.GMLBase.prototype.readLineString = function(node, objectStack) {
|
||||
'localName should be LineString');
|
||||
var flatCoordinates =
|
||||
this.readFlatCoordinatesFromNode_(node, objectStack);
|
||||
if (goog.isDefAndNotNull(flatCoordinates)) {
|
||||
if (flatCoordinates) {
|
||||
var lineString = new ol.geom.LineString(null);
|
||||
lineString.setFlatCoordinates(ol.geom.GeometryLayout.XYZ, flatCoordinates);
|
||||
return lineString;
|
||||
@@ -406,7 +406,7 @@ ol.format.GMLBase.prototype.readFlatLinearRing_ = function(node, objectStack) {
|
||||
var ring = ol.xml.pushParseAndPop(/** @type {Array.<number>} */(null),
|
||||
this.GEOMETRY_FLAT_COORDINATES_PARSERS_, node,
|
||||
objectStack, this);
|
||||
if (goog.isDefAndNotNull(ring)) {
|
||||
if (ring) {
|
||||
return ring;
|
||||
} else {
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user