Procházet zdrojové kódy

solve the problem that some overlay setting labels are invalid

tags/2.9.0
Caven Chen před 3 roky
rodič
revize
d88fcd3f26

+ 15
- 0
modules/overlay/vector/Circle.js Zobrazit soubor

@@ -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

+ 10
- 0
modules/overlay/vector/Rectangle.js Zobrazit soubor

@@ -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
}


Načítá se…
Zrušit
Uložit