Replace goog.isDefAndNotNull() with truthy checks
This commit is contained in:
@@ -484,7 +484,7 @@ ol.format.GeoJSON.prototype.readProjection;
|
||||
ol.format.GeoJSON.prototype.readProjectionFromObject = function(object) {
|
||||
var geoJSONObject = /** @type {GeoJSONObject} */ (object);
|
||||
var crs = geoJSONObject.crs;
|
||||
if (goog.isDefAndNotNull(crs)) {
|
||||
if (crs) {
|
||||
if (crs.type == 'name') {
|
||||
return ol.proj.get(crs.properties.name);
|
||||
} else if (crs.type == 'EPSG') {
|
||||
@@ -530,11 +530,11 @@ ol.format.GeoJSON.prototype.writeFeatureObject = function(
|
||||
'type': 'Feature'
|
||||
};
|
||||
var id = feature.getId();
|
||||
if (goog.isDefAndNotNull(id)) {
|
||||
if (id) {
|
||||
object['id'] = id;
|
||||
}
|
||||
var geometry = feature.getGeometry();
|
||||
if (goog.isDefAndNotNull(geometry)) {
|
||||
if (geometry) {
|
||||
object['geometry'] =
|
||||
ol.format.GeoJSON.writeGeometry_(geometry, opt_options);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user