refactor: 拆分几何对象类的可选配置项类型接口定义

pull/6/head
cbwu 1 year ago
parent 4f2823f073
commit ade03bc747

@ -3,7 +3,7 @@
"semi": false,
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "ignore",
"endOfLine": "auto",
"endOfLine": "lf",
"trailingComma": "all",
"tabWidth": 2
}

@ -0,0 +1,26 @@
/*
* @Author: cbwu 504-wuchengbo@htsdfp.com
* @Date: 2024-04-13 10:36:06
* @LastEditors: cbwu
* @LastEditTime: 2024-04-13 10:56:26
* @Description:
*/
import { Color, Cartesian2 } from 'cesium'
export interface EntityOptions {
id?: string
name?: string
show?: boolean
pixelSize?: number
outlineColor?: Color
color?: Color
fillColor?: Color
fill?: boolean
width?: number
outlineWidth?: number
text?: string
font?: string
pixelOffset?: Cartesian2
image?: string
imageWidth?: number
imageHeight?: number
}

@ -2,7 +2,7 @@
* @Author: cbwu 504-wuchengbo@htsdfp.com
* @Date: 2024-03-22 09:11:54
* @LastEditors: cbwu
* @LastEditTime: 2024-04-01 09:21:17
* @LastEditTime: 2024-04-13 10:49:36
* @Description:
*/
import { Cartesian2, Viewer, Math, Cartographic, Cartesian3 } from 'cesium'

@ -2,7 +2,7 @@
* @Author: cbwu 504-wuchengbo@htsdfp.com
* @Date: 2024-03-27 09:51:04
* @LastEditors: cbwu
* @LastEditTime: 2024-04-10 15:54:02
* @LastEditTime: 2024-04-13 10:46:43
* @Description:
*/
import {

@ -2,7 +2,7 @@
* @Author: cbwu 504-wuchengbo@htsdfp.com
* @Date: 2024-03-27 08:43:44
* @LastEditors: cbwu
* @LastEditTime: 2024-04-12 09:06:27
* @LastEditTime: 2024-04-13 10:46:58
* @Description: Polyline
*/
import {

@ -2,7 +2,7 @@
* @Author: cbwu 504-wuchengbo@htsdfp.com
* @Date: 2024-03-27 11:06:45
* @LastEditors: cbwu
* @LastEditTime: 2024-04-02 11:05:20
* @LastEditTime: 2024-04-13 10:47:09
* @Description:
*/
import {

@ -2,7 +2,7 @@
* @Author: cbwu 504-wuchengbo@htsdfp.com
* @Date: 2024-03-15 08:43:26
* @LastEditors: cbwu
* @LastEditTime: 2024-04-12 10:30:36
* @LastEditTime: 2024-04-13 10:49:27
* @FilePath: \GCSMap\src\utils\drawer.ts
* @Description:
*/

@ -2,7 +2,7 @@
* @Author: cbwu 504-wuchengbo@htsdfp.com
* @Date: 2024-03-22 15:42:49
* @LastEditors: cbwu
* @LastEditTime: 2024-04-01 14:05:43
* @LastEditTime: 2024-04-13 10:49:17
* @Description:
*/
import {

@ -2,7 +2,7 @@
* @Author: cbwu 504-wuchengbo@htsdfp.com
* @Date: 2024-03-28 16:22:58
* @LastEditors: cbwu
* @LastEditTime: 2024-04-12 14:57:49
* @LastEditTime: 2024-04-13 10:45:37
* @Description:
*/
import {
@ -13,7 +13,8 @@ import {
ConstantPositionProperty,
CustomDataSource,
} from 'cesium'
import { PointEntity, EntityOptions } from './pointEntity'
import { PointEntity } from './pointEntity'
import { EntityOptions } from '@/types/entityoptions'
export abstract class BaseGeometry extends CustomDataSource {
static ID: number
// abstract subId: number

@ -2,7 +2,7 @@
* @Author: cbwu 504-wuchengbo@htsdfp.com
* @Date: 2024-04-10 08:53:12
* @LastEditors: cbwu
* @LastEditTime: 2024-04-11 09:09:38
* @LastEditTime: 2024-04-13 10:45:00
* @Description: 广
*/
import { Entity, Cartesian3, Cartesian2, Color, HeightReference } from 'cesium'

@ -2,7 +2,7 @@
* @Author: cbwu 504-wuchengbo@htsdfp.com
* @Date: 2024-03-28 16:35:33
* @LastEditors: cbwu
* @LastEditTime: 2024-04-12 15:43:49
* @LastEditTime: 2024-04-13 10:46:19
* @Description:
*/
import {
@ -16,21 +16,7 @@ import {
CallbackProperty,
Property,
} from 'cesium'
type EntityOptions = {
id?: string
name?: string
show?: boolean
pixelSize?: number
outlineColor?: Color
color?: Color
fillColor?: Color
fill?: boolean
width?: number
outlineWidth?: number
text?: string
font?: string
pixelOffset?: Cartesian2
}
import { EntityOptions } from '@/types/entityoptions'
// 点
class PointEntity extends Entity {
static ID: number = 0
@ -67,4 +53,4 @@ class PointEntity extends Entity {
}
}
export { PointEntity, type EntityOptions }
export { PointEntity }

@ -2,7 +2,7 @@
* @Author: cbwu 504-wuchengbo@htsdfp.com
* @Date: 2024-04-11 09:26:56
* @LastEditors: cbwu
* @LastEditTime: 2024-04-12 15:34:45
* @LastEditTime: 2024-04-13 10:45:27
* @Description: Polygon
*/
import {
@ -13,7 +13,7 @@ import {
PolygonHierarchy,
} from 'cesium'
import { BaseGeometry } from './baseGeometry'
import { type EntityOptions } from './pointEntity'
import { EntityOptions } from '@/types/entityoptions'
export class PolygonEntity extends BaseGeometry {
static ID: number = 0
// positions: Cartesian3[] = []

@ -2,12 +2,12 @@
* @Author: cbwu 504-wuchengbo@htsdfp.com
* @Date: 2024-03-28 16:49:02
* @LastEditors: cbwu
* @LastEditTime: 2024-04-12 14:27:12
* @LastEditTime: 2024-04-13 10:45:17
* @Description: Polyline
*/
import { Entity, Cartesian3, Color, CallbackProperty } from 'cesium'
import { BaseGeometry } from './baseGeometry'
import { type EntityOptions } from './pointEntity'
import { EntityOptions } from '@/types/entityoptions'
export class PolylineEntity extends BaseGeometry {
static ID: number = 0
// positions: Cartesian3[] = []

@ -2,7 +2,7 @@
* @Author: cbwu 504-wuchengbo@htsdfp.com
* @Date: 2024-03-13 09:32:21
* @LastEditors: cbwu
* @LastEditTime: 2024-04-10 14:02:37
* @LastEditTime: 2024-04-13 10:49:06
* @Description:
*/
// Viewer初始化

Loading…
Cancel
Save