| @@ -91,6 +91,21 @@ class Circle extends Overlay { | |||
| this.center = this._center | |||
| } | |||
| /** | |||
| * Sets Text with Style | |||
| * @param text | |||
| * @param textStyle | |||
| * @returns {Circle} | |||
| */ | |||
| setLabel(text, textStyle) { | |||
| this._delegate.position = Transform.transformWGS84ToCartesian(this._center) | |||
| this._delegate.label = { | |||
| ...textStyle, | |||
| text: text | |||
| } | |||
| return this | |||
| } | |||
| /** | |||
| * | |||
| * @param style | |||
| @@ -47,6 +47,16 @@ class Rectangle extends Overlay { | |||
| * @returns {Rectangle} | |||
| */ | |||
| setLabel(text, textStyle) { | |||
| this._delegate.position = Cesium.Cartographic.toCartesian( | |||
| Cesium.Rectangle.center( | |||
| this._delegate.rectangle, | |||
| new Cesium.Cartographic() | |||
| ) | |||
| ) | |||
| this._delegate.label = { | |||
| ...textStyle, | |||
| text: text | |||
| } | |||
| return this | |||
| } | |||