diff --git a/src/ol/geom/multipolygon.js b/src/ol/geom/multipolygon.js index 214398858a..8c5b4cd885 100644 --- a/src/ol/geom/multipolygon.js +++ b/src/ol/geom/multipolygon.js @@ -274,6 +274,14 @@ ol.geom.MultiPolygon.prototype.setCoordinates = */ ol.geom.MultiPolygon.prototype.setFlatCoordinates = function(layout, flatCoordinates, endss) { + goog.asserts.assert(!goog.isNull(endss)); + if (goog.isNull(flatCoordinates) || flatCoordinates.length === 0) { + goog.asserts.assert(endss.length === 0); + } else { + goog.asserts.assert(endss.length > 0); + var ends = endss[endss.length - 1]; + goog.asserts.assert(flatCoordinates.length == ends[ends.length - 1]); + } this.setFlatCoordinatesInternal(layout, flatCoordinates); this.endss_ = endss; this.dispatchChangeEvent();