| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-03 12:18:17 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-06-04 22:01:03 | |||
| * @Last Modified time: 2020-06-25 09:07:16 | |||
| */ | |||
| import { Util } from '../utils' | |||
| import { OverlayEventType, OverlayEvent } from '../event' | |||
| @@ -118,6 +118,20 @@ class Overlay { | |||
| } | |||
| } | |||
| /** | |||
| * set overlay label | |||
| * @param {*} text | |||
| * @param {*} textStyle | |||
| */ | |||
| setLabel(text, textStyle) { | |||
| this._delegate && | |||
| (this._delegate.label = { | |||
| ...textStyle, | |||
| text: text | |||
| }) | |||
| return this | |||
| } | |||
| /** | |||
| * | |||
| * @param {*} style | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-19 10:18:23 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-06-09 17:17:22 | |||
| * @Last Modified time: 2020-06-25 08:54:07 | |||
| */ | |||
| import { Util } from '../../utils' | |||
| @@ -72,19 +72,6 @@ class Billboard extends Overlay { | |||
| this.size = this._size | |||
| } | |||
| /** | |||
| * | |||
| * @param {*} text | |||
| * @param {*} textStyle | |||
| */ | |||
| setLabel(text, textStyle) { | |||
| this._delegate.label = { | |||
| ...textStyle, | |||
| text: text | |||
| } | |||
| return this | |||
| } | |||
| /** | |||
| * | |||
| * @param {*} style | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-31 18:57:02 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-06-04 22:37:13 | |||
| * @Last Modified time: 2020-06-25 08:52:43 | |||
| */ | |||
| import { Util } from '../../utils' | |||
| @@ -78,19 +78,6 @@ class Circle extends Overlay { | |||
| this.radius = this._radius | |||
| } | |||
| /** | |||
| * | |||
| * @param {*} text | |||
| * @param {*} textStyle | |||
| */ | |||
| setLabel(text, textStyle) { | |||
| this._delegate.label = { | |||
| text: text, | |||
| ...textStyle | |||
| } | |||
| return this | |||
| } | |||
| /** | |||
| * | |||
| * @param {*} style | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-02-12 21:46:22 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-06-04 21:50:47 | |||
| * @Last Modified time: 2020-06-25 09:04:04 | |||
| */ | |||
| import { DomUtil, Util } from '../../utils' | |||
| @@ -119,6 +119,15 @@ class DivIcon extends Overlay { | |||
| } | |||
| } | |||
| /** | |||
| * | |||
| * @param {*} text | |||
| * @param {*} textStyle | |||
| */ | |||
| setLabel(text, textStyle) { | |||
| return this | |||
| } | |||
| /** | |||
| * | |||
| * @param {*} name | |||
| @@ -128,7 +137,8 @@ class DivIcon extends Overlay { | |||
| return this | |||
| } | |||
| this._style = style | |||
| style.className && DomUtil.addClass(this._delegate, style.className) | |||
| this._style.className && | |||
| DomUtil.addClass(this._delegate, this._style.className) | |||
| return this | |||
| } | |||
| } | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-02-01 11:59:28 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-06-04 21:53:38 | |||
| * @Last Modified time: 2020-06-25 08:55:22 | |||
| */ | |||
| import { Util } from '../../utils' | |||
| @@ -57,6 +57,15 @@ class Label extends Overlay { | |||
| this.text = this._text | |||
| } | |||
| /** | |||
| * | |||
| * @param {*} text | |||
| * @param {*} textStyle | |||
| */ | |||
| setLabel(text, textStyle) { | |||
| return this | |||
| } | |||
| /** | |||
| * | |||
| * @param {*} style | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-06 15:03:25 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-06-04 21:53:31 | |||
| * @Last Modified time: 2020-06-25 08:55:35 | |||
| */ | |||
| import { Util } from '../../utils' | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-09 09:10:37 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-06-04 22:05:41 | |||
| * @Last Modified time: 2020-06-25 08:59:51 | |||
| */ | |||
| import { Util } from '../../utils' | |||
| @@ -78,6 +78,20 @@ class Polygon extends Overlay { | |||
| this.positions = this._positions | |||
| } | |||
| /** | |||
| * | |||
| * @param {*} text | |||
| * @param {*} textStyle | |||
| */ | |||
| setLabel(text, textStyle) { | |||
| this._delegate.position = Transform.transformWGS84ToCartesian(this.center) | |||
| this._delegate.label = { | |||
| text: text, | |||
| ...textStyle | |||
| } | |||
| return this | |||
| } | |||
| /** | |||
| * | |||
| * @param {*} style | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-06 15:03:25 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-06-04 22:05:39 | |||
| * @Last Modified time: 2020-06-25 09:00:56 | |||
| */ | |||
| import { Util } from '../../utils' | |||
| @@ -50,6 +50,20 @@ class Polyline extends Overlay { | |||
| this.positions = this._positions | |||
| } | |||
| /** | |||
| * | |||
| * @param {*} text | |||
| * @param {*} textStyle | |||
| */ | |||
| setLabel(text, textStyle) { | |||
| this._delegate.position = Transform.transformWGS84ToCartesian(this.center) | |||
| this._delegate.label = { | |||
| text: text, | |||
| ...textStyle | |||
| } | |||
| return this | |||
| } | |||
| /** | |||
| * | |||
| * @param {*} style | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-06 15:03:25 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-06-04 22:37:20 | |||
| * @Last Modified time: 2020-06-25 09:08:04 | |||
| */ | |||
| import { Util } from '../../utils' | |||
| @@ -92,19 +92,6 @@ class Model extends Overlay { | |||
| this.modelUrl = this._modelUrl | |||
| } | |||
| /** | |||
| * | |||
| * @param {*} text | |||
| * @param {*} textStyle | |||
| */ | |||
| setLabel(text, textStyle) { | |||
| this._delegate.label = { | |||
| ...textStyle, | |||
| text: text | |||
| } | |||
| return this | |||
| } | |||
| /** | |||
| * | |||
| * @param {*} style | |||
| @@ -113,6 +100,7 @@ class Model extends Overlay { | |||
| if (!style || Object.keys(style).length === 0) { | |||
| return this | |||
| } | |||
| delete style['uri'] | |||
| this._style = style | |||
| Util.merge(this._delegate.model, this._style) | |||
| return this | |||
| @@ -2,7 +2,7 @@ | |||
| * @Author: Caven | |||
| * @Date: 2020-01-07 08:51:56 | |||
| * @Last Modified by: Caven | |||
| * @Last Modified time: 2020-06-04 22:00:12 | |||
| * @Last Modified time: 2020-06-25 09:02:40 | |||
| */ | |||
| import Parse from '../../parse/Parse' | |||
| @@ -159,6 +159,15 @@ class Tileset extends Overlay { | |||
| return this | |||
| } | |||
| /** | |||
| * | |||
| * @param {*} text | |||
| * @param {*} textStyle | |||
| */ | |||
| setLabel(text, textStyle) { | |||
| return this | |||
| } | |||
| /** | |||
| * | |||
| * @param {*} height | |||