Check arguments passed to ol.geom.MultiPolygon#setFlatCoordinates
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user