@xingm/vmap-cesium-toolbar 0.0.5 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +126 -230
- package/dist/README.md +172 -0
- package/dist/adapters/DrawHelperAdapter.d.ts +143 -0
- package/dist/adapters/MapLoaderAdapter.d.ts +44 -0
- package/dist/adapters/OverlayServiceAdapter.d.ts +102 -0
- package/dist/adapters/ToolbarAdapter.d.ts +71 -0
- package/dist/adapters/index.d.ts +23 -0
- package/dist/components/BaseComponent.d.ts +116 -0
- package/dist/components/SearchBox.d.ts +136 -0
- package/dist/components/Toolbar.d.ts +115 -0
- package/dist/components/ToolbarButton.d.ts +100 -0
- package/dist/components/index.d.ts +33 -0
- package/dist/core/MapPlugin.d.ts +160 -0
- package/dist/core/constants.d.ts +88 -0
- package/dist/core/entities/BaseOverlay.d.ts +156 -0
- package/dist/core/entities/Circle.d.ts +102 -0
- package/dist/core/entities/Icon.d.ts +86 -0
- package/dist/core/entities/InfoWindow.d.ts +116 -0
- package/dist/core/entities/Label.d.ts +92 -0
- package/dist/core/entities/Marker.d.ts +66 -0
- package/dist/core/entities/Polygon.d.ts +93 -0
- package/dist/core/entities/Polyline.d.ts +72 -0
- package/dist/core/entities/Rectangle.d.ts +99 -0
- package/dist/core/entities/Ring.d.ts +114 -0
- package/dist/core/entities/SVG.d.ts +89 -0
- package/dist/core/entities/index.d.ts +27 -0
- package/dist/core/index.d.ts +25 -0
- package/dist/core/layers/BaiduMapLayer.d.ts +37 -0
- package/dist/core/layers/CustomMapLayer.d.ts +43 -0
- package/dist/core/layers/GaodeMapLayer.d.ts +41 -0
- package/dist/core/layers/HeatmapLayer.d.ts +118 -0
- package/dist/core/layers/MapLayer.d.ts +37 -0
- package/dist/core/layers/OSMMapLayer.d.ts +37 -0
- package/dist/core/layers/PointClusterLayer.d.ts +119 -0
- package/dist/core/layers/TDTMapLayer.d.ts +45 -0
- package/dist/core/layers/index.d.ts +15 -0
- package/dist/core/services/draw/DrawInteractionController.d.ts +16 -0
- package/dist/core/services/draw/DrawService.d.ts +38 -0
- package/dist/core/services/draw/DrawSessionStore.d.ts +28 -0
- package/dist/core/services/draw/drawDefaults.d.ts +16 -0
- package/dist/core/services/draw/entities/drawEntityFactory.d.ts +10 -0
- package/dist/core/services/draw/entities/drawEntityRegistry.d.ts +8 -0
- package/dist/core/services/draw/entities/drawFinalFactory.d.ts +14 -0
- package/dist/core/services/draw/entities/drawPreviewFactory.d.ts +15 -0
- package/dist/core/services/draw/geometry/drawGeometry.d.ts +11 -0
- package/dist/core/services/draw/geometry/drawPosition.d.ts +6 -0
- package/dist/core/services/draw/index.d.ts +7 -0
- package/dist/core/services/draw/labels/drawHint.d.ts +16 -0
- package/dist/core/services/draw/labels/measurementCanvas.d.ts +8 -0
- package/dist/core/services/draw/labels/measurementLabelFactory.d.ts +18 -0
- package/dist/core/services/draw/measurementThemeResolver.d.ts +9 -0
- package/dist/core/services/draw/types/drawState.d.ts +37 -0
- package/dist/core/services/draw/types/drawTypes.d.ts +97 -0
- package/dist/core/services/index.d.ts +10 -0
- package/dist/core/services/overlay/OverlayService.d.ts +188 -0
- package/dist/core/services/overlay/index.d.ts +7 -0
- package/dist/core/services/toolbar/ToolbarService.d.ts +175 -0
- package/dist/core/services/toolbar/buttons/BaseButtonHandler.d.ts +111 -0
- package/dist/core/services/toolbar/buttons/LayersButtonHandler.d.ts +47 -0
- package/dist/core/services/toolbar/buttons/MeasureButtonHandler.d.ts +94 -0
- package/dist/core/services/toolbar/buttons/SearchButtonHandler.d.ts +111 -0
- package/dist/core/services/toolbar/buttons/SimpleButtonHandler.d.ts +79 -0
- package/dist/core/services/toolbar/config.d.ts +7 -0
- package/dist/core/services/toolbar/index.d.ts +30 -0
- package/dist/core/services/toolbar/menus/BaseMenu.d.ts +99 -0
- package/dist/core/services/toolbar/menus/MeasureMenu.d.ts +44 -0
- package/dist/core/services/toolbar/types.d.ts +198 -0
- package/dist/core/types.d.ts +586 -0
- package/dist/i18n/en-US.d.ts +46 -0
- package/dist/i18n/index.d.ts +45 -2
- package/dist/i18n/zh-CN.d.ts +46 -0
- package/dist/index.d.ts +37 -42
- package/dist/index.es.js +7056 -9844
- package/dist/index.es.js.map +1 -1
- package/dist/libs/CesiumMapModel.d.ts +1 -172
- package/dist/libs/CesiumMapToolbar.d.ts +1 -1
- package/dist/libs/CesiumOverlayService.d.ts +9 -222
- package/dist/libs/config/CesiumMapConfig.d.ts +5 -12
- package/dist/libs/drawHelper/DrawHint.d.ts +15 -27
- package/dist/libs/drawHelper/index.d.ts +67 -6
- package/dist/libs/toolBar/CesiumMapController.d.ts +38 -64
- package/dist/libs/toolBar/MapLayersService.d.ts +10 -61
- package/dist/libs/toolBar/MapSearchService.d.ts +8 -29
- package/dist/libs/toolBar/MapToolBarConfig.d.ts +33 -5
- package/dist/libs/toolBar/MeasurementService.d.ts +13 -5
- package/dist/libs/toolBar/NotFlyZonesService.d.ts +6 -41
- package/dist/package.json +19 -6
- package/dist/styles/ComponentStyles.d.ts +82 -0
- package/dist/styles/StyleManager.d.ts +142 -0
- package/dist/styles/index.d.ts +128 -0
- package/dist/utils/common.d.ts +4 -0
- package/package.json +1 -1
- package/dist/hooks/toolBarConfig.d.ts +0 -75
- package/dist/hooks/useDrawHelper.d.ts +0 -24
- package/dist/hooks/useDynamicRing.d.ts +0 -44
- package/dist/hooks/useHeatmapHelper.d.ts +0 -18
- package/dist/hooks/useMap.d.ts +0 -14
- package/dist/hooks/useMapInit.d.ts +0 -14
- package/dist/hooks/useOverlayHelper.d.ts +0 -48
- package/dist/hooks/usePointClusterHelper.d.ts +0 -14
- package/dist/index.umd.js +0 -326
- package/dist/index.umd.js.map +0 -1
- package/dist/libs/drawHelper/BaseDraw.d.ts +0 -194
- package/dist/libs/drawHelper/DrawCircle.d.ts +0 -31
- package/dist/libs/drawHelper/DrawLine.d.ts +0 -49
- package/dist/libs/drawHelper/DrawPolgon.d.ts +0 -35
- package/dist/libs/drawHelper/DrawRectangle.d.ts +0 -24
- package/dist/libs/i18n/en-US.d.ts +0 -69
- package/dist/libs/i18n/index.d.ts +0 -25
- package/dist/libs/i18n/zh-CN.d.ts +0 -69
- package/dist/libs/overlay/MapCircle.d.ts +0 -130
- package/dist/libs/overlay/MapIcon.d.ts +0 -69
- package/dist/libs/overlay/MapInfoWindow.d.ts +0 -100
- package/dist/libs/overlay/MapLabel.d.ts +0 -73
- package/dist/libs/overlay/MapMarker.d.ts +0 -60
- package/dist/libs/overlay/MapPolygon.d.ts +0 -114
- package/dist/libs/overlay/MapPolyline.d.ts +0 -64
- package/dist/libs/overlay/MapRectangle.d.ts +0 -101
- package/dist/libs/overlay/MapRing.d.ts +0 -107
- package/dist/libs/overlay/MapSVG.d.ts +0 -73
- package/dist/libs/overlay/OverlayEditController.d.ts +0 -166
- package/dist/libs/overlay/OverlayEditHandles.d.ts +0 -101
- package/dist/libs/overlay/OverlayHighlight.d.ts +0 -40
- package/dist/libs/overlay/index.d.ts +0 -23
- package/dist/libs/overlay/primitives/CirclePrimitiveBatch.d.ts +0 -42
- package/dist/libs/overlay/primitives/CirclePrimitiveLayerStack.d.ts +0 -24
- package/dist/libs/overlay/primitives/PolygonPrimitiveBatch.d.ts +0 -43
- package/dist/libs/overlay/primitives/PolygonPrimitiveLayerStack.d.ts +0 -24
- package/dist/libs/overlay/primitives/RectanglePrimitiveBatch.d.ts +0 -41
- package/dist/libs/overlay/primitives/RectanglePrimitiveLayerStack.d.ts +0 -24
- package/dist/libs/overlay/types.d.ts +0 -121
- package/dist/z.const.d.ts +0 -24
- /package/dist/{libs → utils}/PickGovernor.d.ts +0 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Viewer, Color, MaterialProperty, HeightReference } from '../../../node_modules/cesium';
|
|
2
|
+
import { BaseOverlay, BaseOverlayOptions, OverlayPosition } from './BaseOverlay';
|
|
3
|
+
/**
|
|
4
|
+
* Circle 配置选项
|
|
5
|
+
*/
|
|
6
|
+
export interface CircleOptions extends BaseOverlayOptions {
|
|
7
|
+
/** 圆心位置 */
|
|
8
|
+
position: OverlayPosition;
|
|
9
|
+
/** 半径(米) */
|
|
10
|
+
radius: number;
|
|
11
|
+
/** 填充材质 */
|
|
12
|
+
material?: MaterialProperty | Color | string;
|
|
13
|
+
/** 是否显示边框(默认 true) */
|
|
14
|
+
outline?: boolean;
|
|
15
|
+
/** 边框颜色 */
|
|
16
|
+
outlineColor?: Color | string;
|
|
17
|
+
/** 边框宽度(默认 1) */
|
|
18
|
+
outlineWidth?: number;
|
|
19
|
+
/** 是否贴地(默认 true) */
|
|
20
|
+
clampToGround?: boolean;
|
|
21
|
+
/** 贴地抬高量(米,clampToGround=true 时生效) */
|
|
22
|
+
groundHeightEpsilon?: number;
|
|
23
|
+
/** 高度参考 */
|
|
24
|
+
heightReference?: HeightReference;
|
|
25
|
+
/** 拉伸高度 */
|
|
26
|
+
extrudedHeight?: number;
|
|
27
|
+
/** 兼容旧版渲染模式配置 */
|
|
28
|
+
renderMode?: 'auto' | 'entity' | 'primitive';
|
|
29
|
+
/** 兼容旧版圆周分段数 */
|
|
30
|
+
segments?: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Circle 圆形类
|
|
34
|
+
*
|
|
35
|
+
* 用于在地图上创建圆形区域,支持自定义填充、边框和贴地属性。
|
|
36
|
+
* 使用 Cesium Ellipse 实现。
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* const circle = new Circle(viewer, {
|
|
41
|
+
* position: [120.1, 30.2],
|
|
42
|
+
* radius: 1000,
|
|
43
|
+
* material: 'rgba(255, 0, 0, 0.3)',
|
|
44
|
+
* outline: true,
|
|
45
|
+
* outlineColor: '#FF0000'
|
|
46
|
+
* });
|
|
47
|
+
* viewer.entities.add(circle.getEntity());
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare class Circle extends BaseOverlay {
|
|
51
|
+
private circleOptions;
|
|
52
|
+
private innerEntity?;
|
|
53
|
+
constructor(viewer: Viewer, options: CircleOptions);
|
|
54
|
+
/**
|
|
55
|
+
* 创建粗边框圆形(环形)
|
|
56
|
+
*/
|
|
57
|
+
private createThickCircle;
|
|
58
|
+
/**
|
|
59
|
+
* 创建 EllipseGraphics 对象
|
|
60
|
+
*/
|
|
61
|
+
private createEllipseGraphics;
|
|
62
|
+
/**
|
|
63
|
+
* 生成近似圆(多边形)顶点
|
|
64
|
+
*/
|
|
65
|
+
private generateCirclePositions;
|
|
66
|
+
/**
|
|
67
|
+
* 解析材质
|
|
68
|
+
*/
|
|
69
|
+
private resolveMaterial;
|
|
70
|
+
/**
|
|
71
|
+
* 解析颜色值
|
|
72
|
+
*/
|
|
73
|
+
private resolveColor;
|
|
74
|
+
/**
|
|
75
|
+
* 更新 Circle 配置
|
|
76
|
+
*/
|
|
77
|
+
update(options: Partial<CircleOptions>): void;
|
|
78
|
+
/**
|
|
79
|
+
* 更新几何形状(位置和半径)
|
|
80
|
+
*/
|
|
81
|
+
private updateGeometry;
|
|
82
|
+
/**
|
|
83
|
+
* 更新位置
|
|
84
|
+
*/
|
|
85
|
+
setPosition(position: OverlayPosition): void;
|
|
86
|
+
/**
|
|
87
|
+
* 更新半径
|
|
88
|
+
*/
|
|
89
|
+
setRadius(radius: number): void;
|
|
90
|
+
/**
|
|
91
|
+
* 获取位置(经纬度)
|
|
92
|
+
*/
|
|
93
|
+
getPosition(): [number, number] | null;
|
|
94
|
+
/**
|
|
95
|
+
* 获取半径
|
|
96
|
+
*/
|
|
97
|
+
getRadius(): number;
|
|
98
|
+
/**
|
|
99
|
+
* 从场景中移除圆形
|
|
100
|
+
*/
|
|
101
|
+
remove(): void;
|
|
102
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Viewer, Color, HeightReference, VerticalOrigin, HorizontalOrigin } from '../../../node_modules/cesium';
|
|
2
|
+
import { BaseOverlay, BaseOverlayOptions, OverlayPosition } from './BaseOverlay';
|
|
3
|
+
import * as Cesium from 'cesium';
|
|
4
|
+
/**
|
|
5
|
+
* Icon 配置选项
|
|
6
|
+
*/
|
|
7
|
+
export interface IconOptions extends BaseOverlayOptions {
|
|
8
|
+
/** 图片 URL 或 base64 */
|
|
9
|
+
image: string;
|
|
10
|
+
/** 宽度(像素) */
|
|
11
|
+
width?: number;
|
|
12
|
+
/** 高度(像素) */
|
|
13
|
+
height?: number;
|
|
14
|
+
/** 缩放比例(默认 1.0) */
|
|
15
|
+
scale?: number;
|
|
16
|
+
/** 旋转角度(弧度) */
|
|
17
|
+
rotation?: number;
|
|
18
|
+
/** 像素偏移 */
|
|
19
|
+
pixelOffset?: Cesium.Cartesian2;
|
|
20
|
+
/** 视线偏移 */
|
|
21
|
+
eyeOffset?: Cesium.Cartesian3;
|
|
22
|
+
/** 水平原点(默认 CENTER) */
|
|
23
|
+
horizontalOrigin?: HorizontalOrigin;
|
|
24
|
+
/** 垂直原点(默认 BOTTOM) */
|
|
25
|
+
verticalOrigin?: VerticalOrigin;
|
|
26
|
+
/** 高度参考(默认 NONE) */
|
|
27
|
+
heightReference?: HeightReference;
|
|
28
|
+
/** 禁用深度测试距离 */
|
|
29
|
+
disableDepthTestDistance?: number;
|
|
30
|
+
/** 颜色(可用于着色) */
|
|
31
|
+
color?: Color | string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Icon 图标类
|
|
35
|
+
*
|
|
36
|
+
* 用于在地图上创建图标标记,使用 Billboard 实现。
|
|
37
|
+
* 支持自定义图片、大小、旋转、颜色等样式。
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* const icon = new Icon(viewer, {
|
|
42
|
+
* position: [120.1, 30.2],
|
|
43
|
+
* image: '/images/marker.png',
|
|
44
|
+
* width: 32,
|
|
45
|
+
* height: 32,
|
|
46
|
+
* onClick: (entity) => console.log('Icon clicked')
|
|
47
|
+
* });
|
|
48
|
+
* viewer.entities.add(icon.getEntity());
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export declare class Icon extends BaseOverlay {
|
|
52
|
+
private iconOptions;
|
|
53
|
+
constructor(viewer: Viewer, options: IconOptions);
|
|
54
|
+
/**
|
|
55
|
+
* 创建 BillboardGraphics 对象
|
|
56
|
+
*/
|
|
57
|
+
private createBillboardGraphics;
|
|
58
|
+
/**
|
|
59
|
+
* 解析颜色值
|
|
60
|
+
*/
|
|
61
|
+
private resolveColor;
|
|
62
|
+
/**
|
|
63
|
+
* 更新 Icon 配置
|
|
64
|
+
*/
|
|
65
|
+
update(options: Partial<IconOptions>): void;
|
|
66
|
+
/**
|
|
67
|
+
* 更新位置
|
|
68
|
+
*/
|
|
69
|
+
setPosition(position: OverlayPosition): void;
|
|
70
|
+
/**
|
|
71
|
+
* 更新图片
|
|
72
|
+
*/
|
|
73
|
+
setImage(image: string): void;
|
|
74
|
+
/**
|
|
75
|
+
* 获取图片 URL
|
|
76
|
+
*/
|
|
77
|
+
getImage(): string;
|
|
78
|
+
/**
|
|
79
|
+
* 获取位置(经纬度)
|
|
80
|
+
*/
|
|
81
|
+
getPosition(): [number, number] | null;
|
|
82
|
+
/**
|
|
83
|
+
* 获取图标样式
|
|
84
|
+
*/
|
|
85
|
+
getStyle(): Partial<IconOptions>;
|
|
86
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { Viewer, Entity } from '../../../node_modules/cesium';
|
|
2
|
+
import { BaseOverlay, BaseOverlayOptions, OverlayPosition } from './BaseOverlay';
|
|
3
|
+
import * as Cesium from 'cesium';
|
|
4
|
+
/**
|
|
5
|
+
* InfoWindow 配置选项
|
|
6
|
+
*/
|
|
7
|
+
export interface InfoWindowOptions extends BaseOverlayOptions {
|
|
8
|
+
/** 内容(HTML 字符串或 DOM 元素) */
|
|
9
|
+
content: string | HTMLElement;
|
|
10
|
+
/** 宽度(像素) */
|
|
11
|
+
width?: number;
|
|
12
|
+
/** 高度(像素) */
|
|
13
|
+
height?: number;
|
|
14
|
+
/** 像素偏移 */
|
|
15
|
+
pixelOffset?: Cesium.Cartesian2;
|
|
16
|
+
/** 是否显示(默认 true) */
|
|
17
|
+
show?: boolean;
|
|
18
|
+
/** 是否可关闭 */
|
|
19
|
+
closable?: boolean;
|
|
20
|
+
/** 关闭回调 */
|
|
21
|
+
onClose?: (entity: Entity) => void;
|
|
22
|
+
/** 背景颜色 */
|
|
23
|
+
backgroundColor?: string;
|
|
24
|
+
/** 文字颜色 */
|
|
25
|
+
color?: string;
|
|
26
|
+
/** 字体 */
|
|
27
|
+
font?: string;
|
|
28
|
+
/** 自定义类名 */
|
|
29
|
+
className?: string;
|
|
30
|
+
/** 自定义样式 */
|
|
31
|
+
style?: Partial<CSSStyleDeclaration>;
|
|
32
|
+
/** 是否显示箭头(默认 false) */
|
|
33
|
+
showArrow?: boolean;
|
|
34
|
+
/** 箭头大小(像素,默认 8) */
|
|
35
|
+
arrowSize?: number;
|
|
36
|
+
/** 位置偏移方向(默认 'top') */
|
|
37
|
+
positionOffset?: 'top' | 'bottom' | 'left' | 'right';
|
|
38
|
+
/** 兼容旧版箭头锚点像素 */
|
|
39
|
+
anchorPixel?: number;
|
|
40
|
+
/** 兼容旧版箭头尾部间距 */
|
|
41
|
+
tailGap?: number;
|
|
42
|
+
/** 兼容旧版位置刷新间隔 */
|
|
43
|
+
updateInterval?: number;
|
|
44
|
+
/** 兼容旧版视野外自动隐藏配置 */
|
|
45
|
+
hideWhenOutOfView?: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* InfoWindow 信息窗口类
|
|
49
|
+
*
|
|
50
|
+
* 用于在地图上创建 HTML 信息窗口,支持自定义内容、样式和位置。
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* const infoWindow = new InfoWindow(viewer, {
|
|
55
|
+
* position: [120.1, 30.2],
|
|
56
|
+
* content: '<h3>杭州市</h3><p>浙江省省会</p>',
|
|
57
|
+
* width: 200,
|
|
58
|
+
* closable: true
|
|
59
|
+
* });
|
|
60
|
+
* viewer.entities.add(infoWindow.getEntity());
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare class InfoWindow extends BaseOverlay {
|
|
64
|
+
private infoOptions;
|
|
65
|
+
private container;
|
|
66
|
+
private internalData?;
|
|
67
|
+
constructor(viewer: Viewer, options: InfoWindowOptions, container?: HTMLElement);
|
|
68
|
+
/**
|
|
69
|
+
* 合并选项与默认值
|
|
70
|
+
*/
|
|
71
|
+
private mergeOptions;
|
|
72
|
+
/**
|
|
73
|
+
* 创建 DOM 元素
|
|
74
|
+
*/
|
|
75
|
+
private createDomElement;
|
|
76
|
+
/**
|
|
77
|
+
* 设置监听器
|
|
78
|
+
*/
|
|
79
|
+
private setupListeners;
|
|
80
|
+
/**
|
|
81
|
+
* 将世界坐标转换为相对于 container 的 CSS 像素坐标
|
|
82
|
+
*/
|
|
83
|
+
private getContainerPixelPosition;
|
|
84
|
+
/**
|
|
85
|
+
* 更新 DOM 位置
|
|
86
|
+
*/
|
|
87
|
+
private updateDomPosition;
|
|
88
|
+
/**
|
|
89
|
+
* 更新 InfoWindow 配置
|
|
90
|
+
*/
|
|
91
|
+
update(options: Partial<InfoWindowOptions>): void;
|
|
92
|
+
/**
|
|
93
|
+
* 更新位置
|
|
94
|
+
*/
|
|
95
|
+
setPosition(position: OverlayPosition): void;
|
|
96
|
+
/**
|
|
97
|
+
* 更新内容
|
|
98
|
+
*/
|
|
99
|
+
setContent(content: string | HTMLElement): void;
|
|
100
|
+
/**
|
|
101
|
+
* 显示
|
|
102
|
+
*/
|
|
103
|
+
show(): void;
|
|
104
|
+
/**
|
|
105
|
+
* 隐藏
|
|
106
|
+
*/
|
|
107
|
+
hide(): void;
|
|
108
|
+
/**
|
|
109
|
+
* 从场景中移除信息窗口
|
|
110
|
+
*/
|
|
111
|
+
remove(): void;
|
|
112
|
+
/**
|
|
113
|
+
* 获取位置(经纬度)
|
|
114
|
+
*/
|
|
115
|
+
getPosition(): [number, number] | null;
|
|
116
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Viewer, Color, HeightReference, LabelStyle, VerticalOrigin, HorizontalOrigin } from '../../../node_modules/cesium';
|
|
2
|
+
import { BaseOverlay, BaseOverlayOptions, OverlayPosition } from './BaseOverlay';
|
|
3
|
+
import * as Cesium from 'cesium';
|
|
4
|
+
/**
|
|
5
|
+
* Label 配置选项
|
|
6
|
+
*/
|
|
7
|
+
export interface LabelOptions extends BaseOverlayOptions {
|
|
8
|
+
/** 文本内容 */
|
|
9
|
+
text: string;
|
|
10
|
+
/** 字体(默认 '14px sans-serif') */
|
|
11
|
+
font?: string;
|
|
12
|
+
/** 填充颜色(默认白色) */
|
|
13
|
+
fillColor?: Color | string;
|
|
14
|
+
/** 描边颜色(默认黑色) */
|
|
15
|
+
outlineColor?: Color | string;
|
|
16
|
+
/** 描边宽度(默认 2) */
|
|
17
|
+
outlineWidth?: number;
|
|
18
|
+
/** 标签样式(默认 FILL_AND_OUTLINE) */
|
|
19
|
+
style?: LabelStyle;
|
|
20
|
+
/** 像素偏移 */
|
|
21
|
+
pixelOffset?: Cesium.Cartesian2;
|
|
22
|
+
/** 视线偏移 */
|
|
23
|
+
eyeOffset?: Cesium.Cartesian3;
|
|
24
|
+
/** 水平原点(默认 CENTER) */
|
|
25
|
+
horizontalOrigin?: HorizontalOrigin;
|
|
26
|
+
/** 垂直原点(默认 BOTTOM) */
|
|
27
|
+
verticalOrigin?: VerticalOrigin;
|
|
28
|
+
/** 高度参考(默认 NONE) */
|
|
29
|
+
heightReference?: HeightReference;
|
|
30
|
+
/** 缩放比例(默认 1.0) */
|
|
31
|
+
scale?: number;
|
|
32
|
+
/** 显示背景(默认 false) */
|
|
33
|
+
showBackground?: boolean;
|
|
34
|
+
/** 背景颜色 */
|
|
35
|
+
backgroundColor?: Color | string;
|
|
36
|
+
/** 背景内边距 */
|
|
37
|
+
backgroundPadding?: Cesium.Cartesian2;
|
|
38
|
+
/** 禁用深度测试距离 */
|
|
39
|
+
disableDepthTestDistance?: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Label 文本标签类
|
|
43
|
+
*
|
|
44
|
+
* 用于在地图上创建文本标签,支持自定义字体、颜色、背景等样式。
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* const label = new Label(viewer, {
|
|
49
|
+
* position: [120.1, 30.2],
|
|
50
|
+
* text: '杭州市',
|
|
51
|
+
* font: 'bold 16px sans-serif',
|
|
52
|
+
* fillColor: '#FFFFFF'
|
|
53
|
+
* });
|
|
54
|
+
* viewer.entities.add(label.getEntity());
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare class Label extends BaseOverlay {
|
|
58
|
+
private labelOptions;
|
|
59
|
+
constructor(viewer: Viewer, options: LabelOptions);
|
|
60
|
+
/**
|
|
61
|
+
* 创建 LabelGraphics 对象
|
|
62
|
+
*/
|
|
63
|
+
private createLabelGraphics;
|
|
64
|
+
/**
|
|
65
|
+
* 解析颜色值
|
|
66
|
+
*/
|
|
67
|
+
private resolveColor;
|
|
68
|
+
/**
|
|
69
|
+
* 更新 Label 配置
|
|
70
|
+
*/
|
|
71
|
+
update(options: Partial<LabelOptions>): void;
|
|
72
|
+
/**
|
|
73
|
+
* 更新位置
|
|
74
|
+
*/
|
|
75
|
+
setPosition(position: OverlayPosition): void;
|
|
76
|
+
/**
|
|
77
|
+
* 更新文本
|
|
78
|
+
*/
|
|
79
|
+
setText(text: string): void;
|
|
80
|
+
/**
|
|
81
|
+
* 获取文本内容
|
|
82
|
+
*/
|
|
83
|
+
getText(): string;
|
|
84
|
+
/**
|
|
85
|
+
* 获取位置(经纬度)
|
|
86
|
+
*/
|
|
87
|
+
getPosition(): [number, number] | null;
|
|
88
|
+
/**
|
|
89
|
+
* 获取标签样式
|
|
90
|
+
*/
|
|
91
|
+
getStyle(): Partial<LabelOptions>;
|
|
92
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Viewer, Color, HeightReference } from '../../../node_modules/cesium';
|
|
2
|
+
import { BaseOverlay, BaseOverlayOptions, OverlayPosition } from './BaseOverlay';
|
|
3
|
+
import * as Cesium from 'cesium';
|
|
4
|
+
/**
|
|
5
|
+
* Marker 配置选项
|
|
6
|
+
*/
|
|
7
|
+
export interface MarkerOptions extends BaseOverlayOptions {
|
|
8
|
+
/** 点像素大小(默认 10) */
|
|
9
|
+
pixelSize?: number;
|
|
10
|
+
/** 填充颜色(默认红色) */
|
|
11
|
+
color?: Color | string;
|
|
12
|
+
/** 描边颜色(默认白色) */
|
|
13
|
+
outlineColor?: Color | string;
|
|
14
|
+
/** 描边宽度(默认 2) */
|
|
15
|
+
outlineWidth?: number;
|
|
16
|
+
/** 高度参考(默认 NONE) */
|
|
17
|
+
heightReference?: HeightReference;
|
|
18
|
+
/** 根据距离缩放 */
|
|
19
|
+
scaleByDistance?: Cesium.NearFarScalar;
|
|
20
|
+
/** 禁用深度测试距离 */
|
|
21
|
+
disableDepthTestDistance?: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Marker 点标记类
|
|
25
|
+
*
|
|
26
|
+
* 用于在地图上创建一个点标记,支持自定义颜色、大小、描边等样式。
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const marker = new Marker(viewer, {
|
|
31
|
+
* position: [120.1, 30.2],
|
|
32
|
+
* pixelSize: 12,
|
|
33
|
+
* color: '#FF0000',
|
|
34
|
+
* onClick: (entity) => console.log('Marker clicked')
|
|
35
|
+
* });
|
|
36
|
+
* viewer.entities.add(marker.getEntity());
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare class Marker extends BaseOverlay {
|
|
40
|
+
private markerOptions;
|
|
41
|
+
constructor(viewer: Viewer, options: MarkerOptions);
|
|
42
|
+
/**
|
|
43
|
+
* 创建 PointGraphics 对象
|
|
44
|
+
*/
|
|
45
|
+
private createPointGraphics;
|
|
46
|
+
/**
|
|
47
|
+
* 解析颜色值
|
|
48
|
+
*/
|
|
49
|
+
private resolveColor;
|
|
50
|
+
/**
|
|
51
|
+
* 更新 Marker 配置
|
|
52
|
+
*/
|
|
53
|
+
update(options: Partial<MarkerOptions>): void;
|
|
54
|
+
/**
|
|
55
|
+
* 更新位置
|
|
56
|
+
*/
|
|
57
|
+
setPosition(position: OverlayPosition): void;
|
|
58
|
+
/**
|
|
59
|
+
* 获取位置(经纬度)
|
|
60
|
+
*/
|
|
61
|
+
getPosition(): [number, number] | null;
|
|
62
|
+
/**
|
|
63
|
+
* 获取点样式
|
|
64
|
+
*/
|
|
65
|
+
getStyle(): Partial<MarkerOptions>;
|
|
66
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Viewer, Color, MaterialProperty, HeightReference } from '../../../node_modules/cesium';
|
|
2
|
+
import { BaseOverlay, BaseOverlayOptions, OverlayPosition } from './BaseOverlay';
|
|
3
|
+
/**
|
|
4
|
+
* Polygon 配置选项
|
|
5
|
+
*/
|
|
6
|
+
export interface PolygonOptions extends BaseOverlayOptions {
|
|
7
|
+
/** 位置数组(至少 3 个点) */
|
|
8
|
+
positions: OverlayPosition[];
|
|
9
|
+
/** 填充材质 */
|
|
10
|
+
material?: MaterialProperty | Color | string;
|
|
11
|
+
/** 是否显示边框(默认 true) */
|
|
12
|
+
outline?: boolean;
|
|
13
|
+
/** 边框颜色 */
|
|
14
|
+
outlineColor?: Color | string;
|
|
15
|
+
/** 边框宽度(默认 1) */
|
|
16
|
+
outlineWidth?: number;
|
|
17
|
+
/** 是否贴地(默认 true) */
|
|
18
|
+
clampToGround?: boolean;
|
|
19
|
+
/** 贴地抬高量(米,clampToGround=true 时生效) */
|
|
20
|
+
groundHeightEpsilon?: number;
|
|
21
|
+
/** 高度参考 */
|
|
22
|
+
heightReference?: HeightReference;
|
|
23
|
+
/** 拉伸高度 */
|
|
24
|
+
extrudedHeight?: number;
|
|
25
|
+
/** 兼容旧版渲染模式配置 */
|
|
26
|
+
renderMode?: 'auto' | 'entity' | 'primitive';
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Polygon 多边形类
|
|
30
|
+
*
|
|
31
|
+
* 用于在地图上创建多边形,支持自定义填充、边框和贴地属性。
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* const polygon = new Polygon(viewer, {
|
|
36
|
+
* positions: [
|
|
37
|
+
* [120.1, 30.2],
|
|
38
|
+
* [120.2, 30.3],
|
|
39
|
+
* [120.3, 30.25]
|
|
40
|
+
* ],
|
|
41
|
+
* material: 'rgba(255, 0, 0, 0.5)',
|
|
42
|
+
* outline: true,
|
|
43
|
+
* outlineColor: '#FF0000',
|
|
44
|
+
* outlineWidth: 2
|
|
45
|
+
* });
|
|
46
|
+
* viewer.entities.add(polygon.getEntity());
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare class Polygon extends BaseOverlay {
|
|
50
|
+
private polygonOptions;
|
|
51
|
+
private borderEntity?;
|
|
52
|
+
constructor(viewer: Viewer, options: PolygonOptions);
|
|
53
|
+
/**
|
|
54
|
+
* 创建 PolygonGraphics 对象
|
|
55
|
+
*/
|
|
56
|
+
private createPolygonGraphics;
|
|
57
|
+
/**
|
|
58
|
+
* 创建粗边框折线
|
|
59
|
+
*/
|
|
60
|
+
private createBorderPolyline;
|
|
61
|
+
/**
|
|
62
|
+
* 解析材质
|
|
63
|
+
*/
|
|
64
|
+
private resolveMaterial;
|
|
65
|
+
/**
|
|
66
|
+
* 解析颜色值
|
|
67
|
+
*/
|
|
68
|
+
private resolveColor;
|
|
69
|
+
/**
|
|
70
|
+
* 抬高位置点
|
|
71
|
+
*/
|
|
72
|
+
private elevatePositions;
|
|
73
|
+
/**
|
|
74
|
+
* 更新 Polygon 配置
|
|
75
|
+
*/
|
|
76
|
+
update(options: Partial<PolygonOptions>): void;
|
|
77
|
+
/**
|
|
78
|
+
* 更新位置
|
|
79
|
+
*/
|
|
80
|
+
setPositions(positions: OverlayPosition[]): void;
|
|
81
|
+
/**
|
|
82
|
+
* 获取位置数组(经纬度)
|
|
83
|
+
*/
|
|
84
|
+
getPositions(): [number, number][];
|
|
85
|
+
/**
|
|
86
|
+
* 获取多边形样式
|
|
87
|
+
*/
|
|
88
|
+
getStyle(): Partial<PolygonOptions>;
|
|
89
|
+
/**
|
|
90
|
+
* 从场景中移除多边形
|
|
91
|
+
*/
|
|
92
|
+
remove(): void;
|
|
93
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Viewer, Color, MaterialProperty } from '../../../node_modules/cesium';
|
|
2
|
+
import { BaseOverlay, BaseOverlayOptions, OverlayPosition } from './BaseOverlay';
|
|
3
|
+
/**
|
|
4
|
+
* Polyline 配置选项
|
|
5
|
+
*/
|
|
6
|
+
export interface PolylineOptions extends BaseOverlayOptions {
|
|
7
|
+
/** 位置数组(至少 2 个点) */
|
|
8
|
+
positions: OverlayPosition[];
|
|
9
|
+
/** 线宽(默认 2) */
|
|
10
|
+
width?: number;
|
|
11
|
+
/** 材质(颜色、字符串或 MaterialProperty) */
|
|
12
|
+
material?: MaterialProperty | Color | string;
|
|
13
|
+
/** 是否贴地(默认 false) */
|
|
14
|
+
clampToGround?: boolean;
|
|
15
|
+
/** 贴地抬高量(米,clampToGround=true 时生效) */
|
|
16
|
+
groundHeightEpsilon?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Polyline 折线类
|
|
20
|
+
*
|
|
21
|
+
* 用于在地图上创建折线,支持自定义宽度、材质和贴地属性。
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* const polyline = new Polyline(viewer, {
|
|
26
|
+
* positions: [
|
|
27
|
+
* [120.1, 30.2],
|
|
28
|
+
* [120.2, 30.3],
|
|
29
|
+
* [120.3, 30.4]
|
|
30
|
+
* ],
|
|
31
|
+
* width: 4,
|
|
32
|
+
* material: '#FF0000'
|
|
33
|
+
* });
|
|
34
|
+
* viewer.entities.add(polyline.getEntity());
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare class Polyline extends BaseOverlay {
|
|
38
|
+
private polylineOptions;
|
|
39
|
+
constructor(viewer: Viewer, options: PolylineOptions);
|
|
40
|
+
/**
|
|
41
|
+
* 创建 PolylineGraphics 对象
|
|
42
|
+
*/
|
|
43
|
+
private createPolylineGraphics;
|
|
44
|
+
/**
|
|
45
|
+
* 解析材质
|
|
46
|
+
*/
|
|
47
|
+
private resolveMaterial;
|
|
48
|
+
/**
|
|
49
|
+
* 解析颜色值
|
|
50
|
+
*/
|
|
51
|
+
private resolveColor;
|
|
52
|
+
/**
|
|
53
|
+
* 抬高位置点
|
|
54
|
+
*/
|
|
55
|
+
private elevatePositions;
|
|
56
|
+
/**
|
|
57
|
+
* 更新 Polyline 配置
|
|
58
|
+
*/
|
|
59
|
+
update(options: Partial<PolylineOptions>): void;
|
|
60
|
+
/**
|
|
61
|
+
* 更新位置
|
|
62
|
+
*/
|
|
63
|
+
setPositions(positions: OverlayPosition[]): void;
|
|
64
|
+
/**
|
|
65
|
+
* 获取位置数组(经纬度)
|
|
66
|
+
*/
|
|
67
|
+
getPositions(): [number, number][];
|
|
68
|
+
/**
|
|
69
|
+
* 获取折线样式
|
|
70
|
+
*/
|
|
71
|
+
getStyle(): Partial<PolylineOptions>;
|
|
72
|
+
}
|