Remove goog.isNull in geom classes

This commit is contained in:
Marc Jansen
2015-09-29 15:18:56 +02:00
parent eb5088eb40
commit 3c4e663224
10 changed files with 38 additions and 38 deletions
+6 -6
View File
@@ -63,7 +63,7 @@ goog.inherits(ol.geom.MultiLineString, ol.geom.SimpleGeometry);
ol.geom.MultiLineString.prototype.appendLineString = function(lineString) {
goog.asserts.assert(lineString.getLayout() == this.layout,
'layout of lineString should match the layout');
if (goog.isNull(this.flatCoordinates)) {
if (!this.flatCoordinates) {
this.flatCoordinates = lineString.getFlatCoordinates().slice();
} else {
goog.array.extend(
@@ -270,11 +270,11 @@ ol.geom.MultiLineString.prototype.intersectsExtent = function(extent) {
*/
ol.geom.MultiLineString.prototype.setCoordinates =
function(coordinates, opt_layout) {
if (goog.isNull(coordinates)) {
if (!coordinates) {
this.setFlatCoordinates(ol.geom.GeometryLayout.XY, null, this.ends_);
} else {
this.setLayout(opt_layout, coordinates, 2);
if (goog.isNull(this.flatCoordinates)) {
if (!this.flatCoordinates) {
this.flatCoordinates = [];
}
var ends = ol.geom.flat.deflate.coordinatess(
@@ -292,9 +292,9 @@ ol.geom.MultiLineString.prototype.setCoordinates =
*/
ol.geom.MultiLineString.prototype.setFlatCoordinates =
function(layout, flatCoordinates, ends) {
if (goog.isNull(flatCoordinates)) {
goog.asserts.assert(!goog.isNull(ends) && ends.length === 0,
'ends cannot be null and ends.length should be 0');
if (!flatCoordinates) {
goog.asserts.assert(ends && ends.length === 0,
'ends must be truthy and ends.length should be 0');
} else if (ends.length === 0) {
goog.asserts.assert(flatCoordinates.length === 0,
'flatCoordinates should be an empty array');