diff --git a/Source/Core/PolygonOutlineGeometry.js b/Source/Core/PolygonOutlineGeometry.js index 9146f8db4d0f..834743e6bb2c 100644 --- a/Source/Core/PolygonOutlineGeometry.js +++ b/Source/Core/PolygonOutlineGeometry.js @@ -289,6 +289,9 @@ define([ if (!defined(options) || !defined(options.polygonHierarchy)) { throw new DeveloperError('options.polygonHierarchy is required.'); } + if (defined(options.perPositionHeight) && options.perPositionHeight && defined(options.height)) { + throw new DeveloperError('Cannot use both options.perPositionHeight and options.height'); + } //>>includeEnd('debug'); var polygonHierarchy = options.polygonHierarchy; diff --git a/Specs/Core/PolygonOutlineGeometrySpec.js b/Specs/Core/PolygonOutlineGeometrySpec.js index 9bcd0e871081..cf8c631eea4e 100644 --- a/Specs/Core/PolygonOutlineGeometrySpec.js +++ b/Specs/Core/PolygonOutlineGeometrySpec.js @@ -21,6 +21,15 @@ defineSuite([ }).toThrowDeveloperError(); }); + it('throws with height when perPositionHeight is true', function() { + expect(function() { + return new PolygonOutlineGeometry({ + height: 30, + perPositionHeight: true + }); + }).toThrowDeveloperError(); + }); + it('throws without positions', function() { expect(function() { return PolygonOutlineGeometry.fromPositions();