Переглянути джерело

修改标签设置

tags/1.7.6
Caven Chen 5 роки тому
джерело
коміт
ce903b46f6

+ 15
- 1
src/core/overlay/Overlay.js Переглянути файл

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

+ 1
- 14
src/core/overlay/base/Billboard.js Переглянути файл

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

+ 1
- 14
src/core/overlay/base/Circle.js Переглянути файл

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

+ 12
- 2
src/core/overlay/base/DivIcon.js Переглянути файл

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

+ 10
- 1
src/core/overlay/base/Label.js Переглянути файл

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

+ 1
- 1
src/core/overlay/base/Point.js Переглянути файл

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

+ 15
- 1
src/core/overlay/base/Polygon.js Переглянути файл

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

+ 15
- 1
src/core/overlay/base/Polyline.js Переглянути файл

@@ -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
- 14
src/core/overlay/model/Model.js Переглянути файл

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

+ 10
- 1
src/core/overlay/model/Tileset.js Переглянути файл

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

Завантаження…
Відмінити
Зберегти