gisviewer-vue3-arcgis 1.0.85
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 +103 -0
- package/es/index.d.ts +8 -0
- package/es/index.mjs +16 -0
- package/es/src/components.d.ts +9 -0
- package/es/src/gis-map/gis-map.vue.d.ts +91 -0
- package/es/src/gis-map/gis-map.vue.mjs +124 -0
- package/es/src/gis-map/gis-map.vue2.mjs +4 -0
- package/es/src/gis-map/index.d.ts +81 -0
- package/es/src/gis-map/index.mjs +7 -0
- package/es/src/gis-map/stores/appData.d.ts +3 -0
- package/es/src/gis-map/stores/appData.mjs +9 -0
- package/es/src/gis-map/stores/index.d.ts +7 -0
- package/es/src/gis-map/stores/index.mjs +10 -0
- package/es/src/gis-map/style/index.css +13 -0
- package/es/src/gis-map/utils/FlyToPoints.d.ts +37 -0
- package/es/src/gis-map/utils/FlyToPoints.mjs +67 -0
- package/es/src/gis-map/utils/GreenWaveline.mjs +193 -0
- package/es/src/gis-map/utils/Layers.d.ts +31 -0
- package/es/src/gis-map/utils/Layers.mjs +99 -0
- package/es/src/gis-map/utils/common-utils.d.ts +65 -0
- package/es/src/gis-map/utils/common-utils.mjs +159 -0
- package/es/src/gis-map/utils/holo-flow/index.d.ts +15 -0
- package/es/src/gis-map/utils/holo-flow/index.mjs +50 -0
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow.d.ts +40 -0
- package/es/src/gis-map/utils/holo-flow/signal-holo-flow.mjs +209 -0
- package/es/src/gis-map/utils/holo-flow/trace-external-renderer.d.ts +69 -0
- package/es/src/gis-map/utils/holo-flow/trace-external-renderer.mjs +316 -0
- package/es/src/gis-map/utils/holo-flow/trace-holo-flow.d.ts +18 -0
- package/es/src/gis-map/utils/holo-flow/trace-holo-flow.mjs +75 -0
- package/es/src/gis-map/utils/holo-flow/trace-layer-renderer.d.ts +35 -0
- package/es/src/gis-map/utils/holo-flow/trace-layer-renderer.mjs +286 -0
- package/es/src/gis-map/utils/index.d.ts +21 -0
- package/es/src/gis-map/utils/index.mjs +23 -0
- package/es/src/gis-map/utils/map-initializer.d.ts +50 -0
- package/es/src/gis-map/utils/map-initializer.mjs +248 -0
- package/es/src/gis-map/utils/open-drive-renderer/index.d.ts +9 -0
- package/es/src/gis-map/utils/open-drive-renderer/index.mjs +271 -0
- package/es/src/gis-map/utils/overlay.d.ts +83 -0
- package/es/src/gis-map/utils/overlay.mjs +149 -0
- package/es/src/gis-map/utils/queue-length.d.ts +14 -0
- package/es/src/gis-map/utils/queue-length.mjs +83 -0
- package/es/src/gis-map/utils/renderer/greenWaveline.d.ts +2 -0
- package/es/src/gis-map/utils/renderer/greenWaveline.mjs +169 -0
- package/es/src/gis-map/utils/road-config-tool/cross.d.ts +51 -0
- package/es/src/gis-map/utils/road-config-tool/cross.mjs +127 -0
- package/es/src/gis-map/utils/road-config-tool/entrance.d.ts +24 -0
- package/es/src/gis-map/utils/road-config-tool/entrance.mjs +79 -0
- package/es/src/gis-map/utils/road-config-tool/exit.d.ts +18 -0
- package/es/src/gis-map/utils/road-config-tool/exit.mjs +86 -0
- package/es/src/gis-map/utils/road-config-tool/index.d.ts +44 -0
- package/es/src/gis-map/utils/road-config-tool/index.mjs +112 -0
- package/es/src/gis-map/utils/road-config-tool/indicator-area.d.ts +22 -0
- package/es/src/gis-map/utils/road-config-tool/indicator-area.mjs +44 -0
- package/es/src/gis-map/utils/road-config-tool/lane.d.ts +21 -0
- package/es/src/gis-map/utils/road-config-tool/lane.mjs +35 -0
- package/es/src/gis-map/utils/road-config-tool/search-nearby-lanes.d.ts +62 -0
- package/es/src/gis-map/utils/road-config-tool/search-nearby-lanes.mjs +265 -0
- package/es/src/gis-map/utils/sketchView.d.ts +209 -0
- package/es/src/gis-map/utils/sketchView.mjs +516 -0
- package/es/src/gis-map/utils/sketchViewTool.d.ts +259 -0
- package/es/src/gis-map/utils/sketchViewTool.mjs +503 -0
- package/es/src/gis-map/utils/syncMapView.d.ts +43 -0
- package/es/src/gis-map/utils/syncMapView.mjs +64 -0
- package/es/src/gis-map/utils/traffic-flow.d.ts +66 -0
- package/es/src/gis-map/utils/traffic-flow.mjs +308 -0
- package/es/src/index.d.ts +1 -0
- package/es/src/index.mjs +4 -0
- package/es/src/types/index.d.ts +142 -0
- package/es/src/types/index.mjs +5 -0
- package/lib/index.d.ts +8 -0
- package/lib/index.js +1 -0
- package/lib/src/components.d.ts +9 -0
- package/lib/src/gis-map/gis-map.vue.d.ts +91 -0
- package/lib/src/gis-map/gis-map.vue.js +1 -0
- package/lib/src/gis-map/gis-map.vue2.js +1 -0
- package/lib/src/gis-map/index.d.ts +81 -0
- package/lib/src/gis-map/index.js +1 -0
- package/lib/src/gis-map/stores/appData.d.ts +3 -0
- package/lib/src/gis-map/stores/appData.js +1 -0
- package/lib/src/gis-map/stores/index.d.ts +7 -0
- package/lib/src/gis-map/stores/index.js +1 -0
- package/lib/src/gis-map/style/index.css +13 -0
- package/lib/src/gis-map/utils/FlyToPoints.d.ts +37 -0
- package/lib/src/gis-map/utils/FlyToPoints.js +1 -0
- package/lib/src/gis-map/utils/GreenWaveline.js +1 -0
- package/lib/src/gis-map/utils/Layers.d.ts +31 -0
- package/lib/src/gis-map/utils/Layers.js +1 -0
- package/lib/src/gis-map/utils/common-utils.d.ts +65 -0
- package/lib/src/gis-map/utils/common-utils.js +1 -0
- package/lib/src/gis-map/utils/holo-flow/index.d.ts +15 -0
- package/lib/src/gis-map/utils/holo-flow/index.js +1 -0
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow.d.ts +40 -0
- package/lib/src/gis-map/utils/holo-flow/signal-holo-flow.js +1 -0
- package/lib/src/gis-map/utils/holo-flow/trace-external-renderer.d.ts +69 -0
- package/lib/src/gis-map/utils/holo-flow/trace-external-renderer.js +1 -0
- package/lib/src/gis-map/utils/holo-flow/trace-holo-flow.d.ts +18 -0
- package/lib/src/gis-map/utils/holo-flow/trace-holo-flow.js +1 -0
- package/lib/src/gis-map/utils/holo-flow/trace-layer-renderer.d.ts +35 -0
- package/lib/src/gis-map/utils/holo-flow/trace-layer-renderer.js +1 -0
- package/lib/src/gis-map/utils/index.d.ts +21 -0
- package/lib/src/gis-map/utils/index.js +1 -0
- package/lib/src/gis-map/utils/map-initializer.d.ts +50 -0
- package/lib/src/gis-map/utils/map-initializer.js +1 -0
- package/lib/src/gis-map/utils/open-drive-renderer/index.d.ts +9 -0
- package/lib/src/gis-map/utils/open-drive-renderer/index.js +1 -0
- package/lib/src/gis-map/utils/overlay.d.ts +83 -0
- package/lib/src/gis-map/utils/overlay.js +1 -0
- package/lib/src/gis-map/utils/queue-length.d.ts +14 -0
- package/lib/src/gis-map/utils/queue-length.js +1 -0
- package/lib/src/gis-map/utils/renderer/greenWaveline.d.ts +2 -0
- package/lib/src/gis-map/utils/renderer/greenWaveline.js +43 -0
- package/lib/src/gis-map/utils/road-config-tool/cross.d.ts +51 -0
- package/lib/src/gis-map/utils/road-config-tool/cross.js +1 -0
- package/lib/src/gis-map/utils/road-config-tool/entrance.d.ts +24 -0
- package/lib/src/gis-map/utils/road-config-tool/entrance.js +1 -0
- package/lib/src/gis-map/utils/road-config-tool/exit.d.ts +18 -0
- package/lib/src/gis-map/utils/road-config-tool/exit.js +1 -0
- package/lib/src/gis-map/utils/road-config-tool/index.d.ts +44 -0
- package/lib/src/gis-map/utils/road-config-tool/index.js +1 -0
- package/lib/src/gis-map/utils/road-config-tool/indicator-area.d.ts +22 -0
- package/lib/src/gis-map/utils/road-config-tool/indicator-area.js +1 -0
- package/lib/src/gis-map/utils/road-config-tool/lane.d.ts +21 -0
- package/lib/src/gis-map/utils/road-config-tool/lane.js +1 -0
- package/lib/src/gis-map/utils/road-config-tool/search-nearby-lanes.d.ts +62 -0
- package/lib/src/gis-map/utils/road-config-tool/search-nearby-lanes.js +1 -0
- package/lib/src/gis-map/utils/sketchView.d.ts +209 -0
- package/lib/src/gis-map/utils/sketchView.js +1 -0
- package/lib/src/gis-map/utils/sketchViewTool.d.ts +259 -0
- package/lib/src/gis-map/utils/sketchViewTool.js +1 -0
- package/lib/src/gis-map/utils/syncMapView.d.ts +43 -0
- package/lib/src/gis-map/utils/syncMapView.js +1 -0
- package/lib/src/gis-map/utils/traffic-flow.d.ts +66 -0
- package/lib/src/gis-map/utils/traffic-flow.js +1 -0
- package/lib/src/index.d.ts +1 -0
- package/lib/src/index.js +1 -0
- package/lib/src/types/index.d.ts +142 -0
- package/lib/src/types/index.js +1 -0
- package/package.json +41 -0
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import GraphicsLayer from '@arcgis/core/layers/GraphicsLayer';
|
|
2
|
+
import MapView from '@arcgis/core/views/MapView';
|
|
3
|
+
import SceneView from '@arcgis/core/views/SceneView';
|
|
4
|
+
import SketchViewModel from '@arcgis/core/widgets/Sketch/SketchViewModel';
|
|
5
|
+
import Sketch from '@arcgis/core/widgets/Sketch';
|
|
6
|
+
import Graphic from '@arcgis/core/Graphic.js';
|
|
7
|
+
import * as turf from '@turf/turf';
|
|
8
|
+
interface sketchViewOptions {
|
|
9
|
+
/**
|
|
10
|
+
* 最大允许绘制的图形数量
|
|
11
|
+
*/
|
|
12
|
+
maxAllowedGraphics?: number;
|
|
13
|
+
/**
|
|
14
|
+
* 图形图层配置
|
|
15
|
+
*/
|
|
16
|
+
GraphicsLayer?: {};
|
|
17
|
+
/**
|
|
18
|
+
* 绘制工具显示的元素
|
|
19
|
+
*/
|
|
20
|
+
sketchvisibleElements?: {};
|
|
21
|
+
/**
|
|
22
|
+
* 绘制工具显示的位置
|
|
23
|
+
*/
|
|
24
|
+
sketchPosition?: string;
|
|
25
|
+
/**
|
|
26
|
+
* 绘制工具默认是否显示
|
|
27
|
+
*
|
|
28
|
+
* @type {boolean}
|
|
29
|
+
* @memberof sketchViewOptions
|
|
30
|
+
*/
|
|
31
|
+
defaultsketchVisible?: boolean;
|
|
32
|
+
sketchViewModelItemSymbol?: {
|
|
33
|
+
polylineSymbol?: any;
|
|
34
|
+
polygonSymbol?: any;
|
|
35
|
+
pointSymbol?: any;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
interface ITPoint {
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
}
|
|
42
|
+
declare type LinearUnits = 'meters' | 'feet' | 'kilometers' | 'miles' | 'nautical-miles' | 'yards' | number;
|
|
43
|
+
declare type Direction = 'north' | 'east' | 'south' | 'west';
|
|
44
|
+
declare type dimensionTypeFace = 'distance' | 'area' | 'angle' | null;
|
|
45
|
+
export default class sketchViewTool {
|
|
46
|
+
private viewer;
|
|
47
|
+
graphicsLayer: GraphicsLayer;
|
|
48
|
+
TextgraphicsLayer: GraphicsLayer;
|
|
49
|
+
sketchViewModel: SketchViewModel;
|
|
50
|
+
sketch: Sketch;
|
|
51
|
+
options: sketchViewOptions;
|
|
52
|
+
/**
|
|
53
|
+
* 是否正在绘制
|
|
54
|
+
*
|
|
55
|
+
* @type {boolean}
|
|
56
|
+
* @memberof sketchViewTool
|
|
57
|
+
*/
|
|
58
|
+
isDraw: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* 当前绘制的图形
|
|
61
|
+
*/
|
|
62
|
+
drawStartGraphic: __esri.Geometry | null;
|
|
63
|
+
/**
|
|
64
|
+
* 当前绘制的图形的id
|
|
65
|
+
*
|
|
66
|
+
* @type {(string | null)}
|
|
67
|
+
* @memberof sketchViewTool
|
|
68
|
+
*/
|
|
69
|
+
drawStartGraphicId: string | null;
|
|
70
|
+
/**
|
|
71
|
+
* 绘制的提示dom
|
|
72
|
+
*
|
|
73
|
+
* @type {(HTMLElement | null)}
|
|
74
|
+
* @memberof sketchViewTool
|
|
75
|
+
*/
|
|
76
|
+
tipsDom: HTMLElement | null;
|
|
77
|
+
drawPointGraphic: Map<string, Graphic>;
|
|
78
|
+
dimensionType: dimensionTypeFace;
|
|
79
|
+
constructor(view: MapView | SceneView, options?: sketchViewOptions);
|
|
80
|
+
init(): void;
|
|
81
|
+
on(callcack?: (type: string, state: string, event: any) => void): void;
|
|
82
|
+
onCreate(event: __esri.SketchCreateEvent, callcack?: (type: string, state: string, event?: any) => void): void;
|
|
83
|
+
onCreateToCancel(): void;
|
|
84
|
+
onUpdate(event: __esri.SketchUpdateEvent, callcack?: (type: string, state: string, event?: any) => void): void;
|
|
85
|
+
onDelete(event: __esri.SketchDeleteEvent, callcack?: (type: string, state: string, event: any) => void): void;
|
|
86
|
+
addpolyline(paths: number[][][]): void;
|
|
87
|
+
createPolylineGraphic(paths: number[][], lineSymbol: any, attributes: any): Graphic;
|
|
88
|
+
createDom(): HTMLDivElement | undefined;
|
|
89
|
+
removeDom(): void;
|
|
90
|
+
/**
|
|
91
|
+
* 开始绘制
|
|
92
|
+
* @param tool 'point' | 'polyline' | 'polygon' | 'rectangle' | 'circle'
|
|
93
|
+
* @param createOptions
|
|
94
|
+
*/
|
|
95
|
+
sketchCreate(tool: 'point' | 'polyline' | 'polygon' | 'rectangle' | 'circle', createOptions?: __esri.SketchViewModelCreateCreateOptions): void;
|
|
96
|
+
/**
|
|
97
|
+
* 退出绘制
|
|
98
|
+
*
|
|
99
|
+
* @memberof sketchViewTool
|
|
100
|
+
*/
|
|
101
|
+
sketchCancel(): void;
|
|
102
|
+
/**
|
|
103
|
+
* 获取所有的图形得长度
|
|
104
|
+
* @param offsetUnit 距离单位
|
|
105
|
+
* @returns
|
|
106
|
+
*/
|
|
107
|
+
getCalculateDistance(offsetUnit?: LinearUnits): (string | number)[];
|
|
108
|
+
/**
|
|
109
|
+
* 获取所有的图形得航向角
|
|
110
|
+
*
|
|
111
|
+
* @returns
|
|
112
|
+
* @memberof sketchViewTool
|
|
113
|
+
*/
|
|
114
|
+
getCalculateHeading(direction?: Direction): (string | number)[];
|
|
115
|
+
/**
|
|
116
|
+
* 获取所有的线段的路径和长度
|
|
117
|
+
*
|
|
118
|
+
* @returns
|
|
119
|
+
* @memberof sketchViewTool
|
|
120
|
+
*/
|
|
121
|
+
getAllPolylineGraphicPath(offsetUnit?: LinearUnits): {
|
|
122
|
+
paths: number[][];
|
|
123
|
+
distance: number;
|
|
124
|
+
}[];
|
|
125
|
+
close(): void;
|
|
126
|
+
show(): void;
|
|
127
|
+
removeAll(): void;
|
|
128
|
+
calculateDistance(geometry: __esri.Geometry, offsetUnit?: LinearUnits): number;
|
|
129
|
+
/**
|
|
130
|
+
* 计算geometry的航向角
|
|
131
|
+
*
|
|
132
|
+
* @param {__esri.Geometry} geometry
|
|
133
|
+
* @param {string} [direction='north']
|
|
134
|
+
* @returns
|
|
135
|
+
* @memberof sketchViewTool
|
|
136
|
+
*/
|
|
137
|
+
calculateHeading(geometry: __esri.Geometry, direction?: string): number;
|
|
138
|
+
/**
|
|
139
|
+
* 计算路径的航向角
|
|
140
|
+
*
|
|
141
|
+
* @param {number[][]} path 路径
|
|
142
|
+
* @param {string} [direction='north'] 方向
|
|
143
|
+
* @returns
|
|
144
|
+
* @memberof sketchViewTool
|
|
145
|
+
*/
|
|
146
|
+
calculatePointHeading(path: number[][], direction?: string): number;
|
|
147
|
+
drawPolylinePoint(drawStartGraphic: __esri.Geometry, parentId: string, actions?: string): void;
|
|
148
|
+
updatePpolylinePoint(drawStartGraphic: Graphic[]): void;
|
|
149
|
+
delPpolylinePoint(drawStartGraphic: Graphic[]): void;
|
|
150
|
+
/**
|
|
151
|
+
* 添加或者更新标记点
|
|
152
|
+
*
|
|
153
|
+
* @param {string} text 标记点的文本
|
|
154
|
+
* @param {ITPoint} point 标记点的坐标
|
|
155
|
+
* @param {string} id 标记点的id
|
|
156
|
+
* @param {*} [attributes={}] 标记点的属性
|
|
157
|
+
* @returns
|
|
158
|
+
* @memberof sketchViewTool
|
|
159
|
+
*/
|
|
160
|
+
addOrUpdateMarkPoint(text: string, point: ITPoint, id: string, attributes?: any): void;
|
|
161
|
+
/**
|
|
162
|
+
* 获取图形的点位
|
|
163
|
+
*
|
|
164
|
+
* @param {__esri.Geometry} geometry
|
|
165
|
+
* @returns
|
|
166
|
+
* @memberof sketchViewTool
|
|
167
|
+
*/
|
|
168
|
+
getGeometryXY(geometry: __esri.Geometry, index?: number): {
|
|
169
|
+
x: number;
|
|
170
|
+
y: number;
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* 创建文本图形
|
|
174
|
+
*
|
|
175
|
+
* @param {string} text 文本
|
|
176
|
+
* @param {{ x: number; y: number }} point 坐标
|
|
177
|
+
* @param {*} [attributes={}] 属性
|
|
178
|
+
* @returns
|
|
179
|
+
* @memberof sketchViewTool
|
|
180
|
+
*/
|
|
181
|
+
createTextGraphic(text: string, point: {
|
|
182
|
+
x: number;
|
|
183
|
+
y: number;
|
|
184
|
+
}, attributes?: any): Graphic;
|
|
185
|
+
/**
|
|
186
|
+
* 获取当前绘制的图形的长度
|
|
187
|
+
* @returns
|
|
188
|
+
*/
|
|
189
|
+
getDrawgraphicLength(): string | 0;
|
|
190
|
+
/**
|
|
191
|
+
* 获取两点的角度
|
|
192
|
+
*
|
|
193
|
+
* @param {ITPoint} startPoint
|
|
194
|
+
* @param {ITPoint} endPoint
|
|
195
|
+
* @returns
|
|
196
|
+
* @memberof SketchView
|
|
197
|
+
*/
|
|
198
|
+
getAngle(startPoint: ITPoint, endPoint: ITPoint): number;
|
|
199
|
+
/**
|
|
200
|
+
* 获取两点的方位角
|
|
201
|
+
*
|
|
202
|
+
* @param {ITPoint} startPoint
|
|
203
|
+
* @param {ITPoint} endPoint
|
|
204
|
+
* @returns
|
|
205
|
+
* @memberof sketchViewTool
|
|
206
|
+
*/
|
|
207
|
+
getbearing(startPoint: ITPoint, endPoint: ITPoint): number;
|
|
208
|
+
/**
|
|
209
|
+
* 获取两点的距离
|
|
210
|
+
* @param startPoint
|
|
211
|
+
* @param endPoint
|
|
212
|
+
* @param units
|
|
213
|
+
* @returns
|
|
214
|
+
*/
|
|
215
|
+
getPointLength(paths: number[][], units?: LinearUnits): number;
|
|
216
|
+
/**
|
|
217
|
+
* 获取多个点的中心点
|
|
218
|
+
*
|
|
219
|
+
* @param {ITPoint[]} points
|
|
220
|
+
* @returns
|
|
221
|
+
* @memberof sketchViewTool
|
|
222
|
+
*/
|
|
223
|
+
featureCollection(points: ITPoint[]): turf.helpers.Feature<turf.helpers.Point, turf.helpers.Properties>;
|
|
224
|
+
/**
|
|
225
|
+
* 获取两点的中心点
|
|
226
|
+
*
|
|
227
|
+
* @param {ITPoint} startPoint
|
|
228
|
+
* @param {ITPoint} endPoint
|
|
229
|
+
* @returns
|
|
230
|
+
* @memberof sketchViewTool
|
|
231
|
+
*/
|
|
232
|
+
midpoint(startPoint: ITPoint, endPoint: ITPoint): turf.helpers.Feature<turf.helpers.Point, turf.helpers.Properties>;
|
|
233
|
+
/**
|
|
234
|
+
* 获取方向
|
|
235
|
+
*
|
|
236
|
+
* @param {ITPoint} startPoint 起点
|
|
237
|
+
* @param {ITPoint} endPoint 终点
|
|
238
|
+
* @returns
|
|
239
|
+
* @memberof SketchView
|
|
240
|
+
*/
|
|
241
|
+
getDirection(startPoint: ITPoint, endPoint: ITPoint): 0 | 1 | 3 | 2;
|
|
242
|
+
findLayerById(id: string): __esri.Layer;
|
|
243
|
+
/**
|
|
244
|
+
* 开启图层捕捉
|
|
245
|
+
*/
|
|
246
|
+
turnonlayerSnap(): void;
|
|
247
|
+
/**
|
|
248
|
+
* 关闭图层捕捉
|
|
249
|
+
*/
|
|
250
|
+
turnofflayerSnap(): void;
|
|
251
|
+
setDimensionType(Type: dimensionTypeFace): void;
|
|
252
|
+
/**
|
|
253
|
+
* 删除指定的图形
|
|
254
|
+
* @param graphic 删除指定的图形
|
|
255
|
+
*/
|
|
256
|
+
remove(graphic: any): void;
|
|
257
|
+
destroy(): void;
|
|
258
|
+
}
|
|
259
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("@arcgis/core/layers/GraphicsLayer"),b=require("@arcgis/core/widgets/Sketch/SketchViewModel"),G=require("@arcgis/core/widgets/Sketch"),M=require("@arcgis/core/geometry/support/webMercatorUtils.js"),D=require("@arcgis/core/geometry/geometryEngine.js"),m=require("@arcgis/core/Graphic.js"),f=require("@arcgis/core/geometry/Polyline.js"),L=require("@turf/turf");function y(d){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(d){for(const e in d)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(d,e);Object.defineProperty(t,e,i.get?i:{enumerable:!0,get:()=>d[e]})}}return t.default=d,Object.freeze(t)}const p=y(M),w=y(D),c=y(L),T={maxAllowedGraphics:0,GraphicsLayer:{},sketchvisibleElements:{},sketchPosition:"top-left",defaultsketchVisible:!0,sketchViewModelItemSymbol:{}},x={type:"simple-line",color:"#556DEA",width:2},k={type:"simple-fill",color:[227,139,79,.4],outline:{color:[255,255,255],width:1}};class S{constructor(t,e){this.isDraw=!1,this.drawStartGraphicId=null,this.drawPointGraphic=new Map,this.dimensionType=null,this.viewer=t,this.options={...T,...e},this.graphicsLayer=new u({...this.options.GraphicsLayer}),this.TextgraphicsLayer=new u,this.viewer.map.layers.add(this.graphicsLayer),this.viewer.map.layers.add(this.TextgraphicsLayer),this.init()}init(){this.sketchViewModel=new b({layer:this.graphicsLayer,view:this.viewer,updateOnGraphicClick:!0,polylineSymbol:x,polygonSymbol:k,...this.options.sketchViewModelItemSymbol});const t=this.findLayerById("TrafficToolMarkings"),e=[];t&&e.push({layer:t,enabled:!0}),this.sketch=new G({view:this.viewer,viewModel:this.sketchViewModel,layer:this.graphicsLayer,visible:this.options.defaultsketchVisible,snappingOptions:{enabled:!0,featureSources:e}}),this.sketch.visibleElements={...this.options.sketchvisibleElements},this.viewer.ui.add(this.sketch,this.options.sketchPosition);const i=this;this.viewer.on("pointer-move",function(s){const r={x:s.x,y:s.y};if(i.isDraw&&i.dimensionType=="distance"){i.tipsDom||(i.tipsDom=i.createDom());const o=i.getDrawgraphicLength();i.tipsDom.innerText=`${o}米`,i.tipsDom.style.left=`${r.x}px`,i.tipsDom.style.top=`${r.y+3}px`,i.tipsDom.style.pointerEvents="none"}})}on(t){const e=this;this.sketch.on("create",function(i){e.onCreate(i,t)}),this.sketch.on("update",function(i){e.onUpdate(i,t)}),this.sketch.on("delete",function(i){e.onDelete(i,t)}),this.sketch.on("redo",function(i){console.log("redo",i),t&&t("redo","complete",i)}),this.sketch.on("undo",function(i){console.log("undo",i),t&&t("undo","complete",i)})}onCreate(t,e){if(console.log("create",t),this.drawStartGraphicId||(this.drawStartGraphicId=new Date().getTime().toString()),t.graphic.getAttribute("id")||(t.graphic.setAttribute("type","draw"),t.graphic.setAttribute("id",this.drawStartGraphicId)),t.state==="start"&&t.graphic.geometry.type==="polyline"&&(this.isDraw=!0,this.drawStartGraphic=p.webMercatorToGeographic(t.graphic.geometry),this.dimensionType=="distance")){const i=this.getGeometryXY(this.drawStartGraphic,0),s=`${this.drawStartGraphicId}-start`;this.addOrUpdateMarkPoint("起点",i,s)}if(t.state==="active"&&t.graphic.geometry.type==="polyline"){const i=p.webMercatorToGeographic(t.graphic.geometry),s=this.drawStartGraphicId;this.dimensionType=="distance"&&(this.drawPolylinePoint(i,s),this.drawStartGraphic=i)}if(t.state==="complete"&&t.graphic.geometry.type==="polyline"&&this.dimensionType=="distance"){const i=this.getDrawgraphicLength(),s=`${this.drawStartGraphicId}-end`,r=p.webMercatorToGeographic(t.graphic.geometry),o=r.paths[0],n=this.getGeometryXY(r,o.length-1);this.addOrUpdateMarkPoint(`总长度:${i}米`,n,s),this.drawStartGraphic=null,this.removeDom(),this.isDraw=!1,this.drawStartGraphicId=null}t.state==="cancel"&&t.graphic.geometry.type==="polyline"&&this.onCreateToCancel(),e&&e("create",t.state,t.graphic)}onCreateToCancel(){this.removeDom(),this.isDraw=!1,this.drawStartGraphic=null;const t=this.drawStartGraphicId;this.drawPointGraphic.forEach((e,i)=>{new RegExp(`^${t}-`).test(i)&&(this.TextgraphicsLayer.remove(e),this.drawPointGraphic.delete(i))}),this.drawStartGraphicId=null}onUpdate(t,e){console.log("update",t),this.updatePpolylinePoint(t.graphics.filter(i=>i.geometry.type==="polyline")),e&&e("update",t.state,t.graphics)}onDelete(t,e){console.log("delete",t),this.delPpolylinePoint(t.graphics.filter(i=>i.geometry.type==="polyline")),e&&e("delete","complete",t.graphics)}addpolyline(t){const e=[],i=x,s={type:"draw",id:new Date().getTime().toString()};t.map(r=>{e.push(this.createPolylineGraphic(r,i,{...s}))}),this.graphicsLayer.addMany(e)}createPolylineGraphic(t,e,i){const s=new f({paths:[t]}),r=p.geographicToWebMercator(s);return new m({geometry:r,symbol:e,attributes:i})}createDom(){const t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.width="100px",t.style.height="80px",t.style.zIndex="999",t.style.display="flex",t.style.justifyContent="center",t.style.alignItems="center",t.style.color="#fff",t.style.fontSize="20px",t.style.fontWeight="bold",t.innerText="";const e=document.getElementsByClassName("esri-view-root");if(e.length>0)return e[0].appendChild(t),t}removeDom(){this.tipsDom&&(this.tipsDom.remove(),this.tipsDom=null)}sketchCreate(t,e){this.sketchViewModel.create(t,e)}sketchCancel(){this.sketchViewModel.cancel()}getCalculateDistance(t="meters"){const e=[];return this.graphicsLayer.graphics.map(i=>{i.geometry.type==="polyline"&&e.push(this.calculateDistance(i.geometry,t))}),e}getCalculateHeading(t="north"){const e=[];return this.graphicsLayer.graphics.map(i=>{i.geometry.type==="polyline"&&e.push(this.calculateHeading(i.geometry,t))}),e}getAllPolylineGraphicPath(t="meters"){const e=[];return this.graphicsLayer.graphics.map(i=>{i.geometry.type==="polyline"&&e.push({paths:p.webMercatorToGeographic(i.geometry).paths[0],distance:this.calculateDistance(i.geometry,t)})}),e}close(){this.sketch.visible=!1}show(){this.sketch.visible=!0}removeAll(){this.graphicsLayer.removeAll(),this.TextgraphicsLayer.removeAll(),this.drawPointGraphic.clear()}calculateDistance(t,e="meters"){return w.geodesicLength(t,e)}calculateHeading(t,e="north"){const s=p.webMercatorToGeographic(t).paths[0];return this.calculatePointHeading(s,e)}calculatePointHeading(t,e="north"){const i={longitude:t[0][0],latitude:t[0][1]},s={longitude:t[t.length-1][0],latitude:t[t.length-1][1]},r=i.longitude,o=i.latitude,n=s.longitude,a=s.latitude,h=n-r,g=Math.sin(h)*Math.cos(a),P=Math.cos(o)*Math.sin(a)-Math.sin(o)*Math.cos(a)*Math.cos(h);let l=(Math.atan2(g,P)*(180/Math.PI)+360)%360;return e==="east"?l=(l+90)%360:e==="south"?l=(l+180)%360:e==="west"&&(l=(l+270)%360),l}drawPolylinePoint(t,e,i="add"){const s=t==null?void 0:t.paths[0],r=[];for(let o=0;o<s.length-1;o++){const n=s[o];r.push([...n]);const a={x:n[0],y:n[1]};if(o==0){i=="update"&&this.addOrUpdateMarkPoint("起点",a,`${e}-start`);continue}const h=`${e}-${o+1}`,g=this.getPointLength(r,"meters");this.addOrUpdateMarkPoint(`${g.toFixed(2)}米`,a,h)}if(i=="update"&&s.length>1){const o=this.getGeometryXY(t,s.length-1);r.push([o.x,o.y]);const n=this.getPointLength(r,"meters");this.addOrUpdateMarkPoint(`总长度:${n.toFixed(2)}米`,o,`${e}-end`)}}updatePpolylinePoint(t){for(let e=0;e<t.length;e++){console.log(t[e]);const i=t[e].getAttribute("id"),s=p.webMercatorToGeographic(t[e].geometry);this.drawPolylinePoint(s,i,"update")}}delPpolylinePoint(t){var e;for(let i=0;i<t.length;i++){const s=t[i].getAttribute("id"),r=`${s}-start`,o=`${s}-end`,n=[r,o];(e=t[i].geometry)==null||e.paths[0].map((a,h)=>{n.push(`${s}-${h+1}`)}),n.map(a=>{const h=this.drawPointGraphic.get(a);h&&(this.TextgraphicsLayer.remove(h),this.drawPointGraphic.delete(a))})}}addOrUpdateMarkPoint(t,e,i,s={}){if(this.drawPointGraphic.has(i)){const o=this.drawPointGraphic.get(i);this.TextgraphicsLayer.remove(o);const n=this.createTextGraphic(t,e,{...s,id:i});this.drawPointGraphic.set(i,n),this.TextgraphicsLayer.add(n);return}const r=this.createTextGraphic(t,e,{...s,id:i});this.drawPointGraphic.set(i,r),this.TextgraphicsLayer.add(r)}getGeometryXY(t,e=0){const i=t==null?void 0:t.paths[0];return{x:i[e][0],y:i[e][1]}}createTextGraphic(t,e,i={}){return new m({geometry:{type:"point",x:e.x,y:e.y},symbol:{type:"text",text:t,color:"white",haloColor:"black",haloSize:"1px",xoffset:3,yoffset:3},attributes:{...i}})}getDrawgraphicLength(){return this.drawStartGraphic?this.calculateDistance(this.drawStartGraphic,"meters").toFixed(2):0}getAngle(t,e){const i=e.x-t.x,s=e.y-t.y;return Math.atan2(s,i)*180/Math.PI}getbearing(t,e){return c.bearing(c.point([t.x,t.y]),c.point([e.x,e.y]))}getPointLength(t,e="meters"){const i=new f({paths:[t]});return w.geodesicLength(i,e)}featureCollection(t){const e=c.featureCollection(t.map(s=>c.point([s.x,s.y])));return c.center(e)}midpoint(t,e){return c.midpoint(c.point([t.x,t.y]),c.point([e.x,e.y]))}getDirection(t,e){const i=e.x-t.x,s=e.y-t.y,o=Math.atan2(s,i)*180/Math.PI;return o>=-45&&o<=45?0:o>45&&o<=135?1:o>135||o<=-135?2:3}findLayerById(t){return this.viewer.map.findLayerById(t)}turnonlayerSnap(){this.sketchViewModel.snappingOptions.enabled=!0}turnofflayerSnap(){this.sketchViewModel.snappingOptions.enabled=!1}setDimensionType(t){this.dimensionType=t}remove(t){this.graphicsLayer.remove(t)}destroy(){var t,e;this.viewer.map.remove(this.graphicsLayer),this.viewer.map.remove(this.TextgraphicsLayer),(t=this.sketch)==null||t.destroy(),(e=this.sketchViewModel)==null||e.destroy()}}exports.default=S;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import MapView from '@arcgis/core/views/MapView';
|
|
2
|
+
import SceneView from '@arcgis/core/views/SceneView';
|
|
3
|
+
export default class syncMapView {
|
|
4
|
+
private mainMapView;
|
|
5
|
+
private targetMapViews;
|
|
6
|
+
private syncHandles;
|
|
7
|
+
private isSync;
|
|
8
|
+
constructor(targetMapViews: MapView[] | SceneView[]);
|
|
9
|
+
/**
|
|
10
|
+
* 设置是否同步
|
|
11
|
+
*
|
|
12
|
+
* @param {boolean} isSync
|
|
13
|
+
* @memberof syncMapView
|
|
14
|
+
*/
|
|
15
|
+
setSync(isSync: boolean): void;
|
|
16
|
+
/**
|
|
17
|
+
*设置主视图
|
|
18
|
+
*
|
|
19
|
+
* @private
|
|
20
|
+
* @param {(MapView | SceneView)} mainMapView
|
|
21
|
+
* @memberof syncMapView
|
|
22
|
+
*/
|
|
23
|
+
private setMainMapView;
|
|
24
|
+
/**
|
|
25
|
+
*开始同步视角
|
|
26
|
+
*
|
|
27
|
+
* @private
|
|
28
|
+
* @memberof syncMapView
|
|
29
|
+
*/
|
|
30
|
+
private startSync;
|
|
31
|
+
/**
|
|
32
|
+
* 暂停同步视角
|
|
33
|
+
*
|
|
34
|
+
* @memberof syncMapView
|
|
35
|
+
*/
|
|
36
|
+
pauseSync(): void;
|
|
37
|
+
/**
|
|
38
|
+
*销毁同步
|
|
39
|
+
*
|
|
40
|
+
* @memberof syncMapView
|
|
41
|
+
*/
|
|
42
|
+
destroy(): void;
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});class e{constructor(s){if(this.syncHandles=[],this.isSync=!1,s.length<2)throw new Error("At least two viewers are required for synchronization.");this.mainMapView=null,this.targetMapViews=s,s.forEach(i=>{i.on("drag",()=>{this.setMainMapView(i)})})}setSync(s){this.isSync=s}setMainMapView(s){this.mainMapView!==s&&(this.pauseSync(),this.mainMapView=s,this.startSync())}startSync(){this.syncHandles=this.targetMapViews.map(s=>s.watch("viewpoint",i=>{this.mainMapView===s&&this.isSync&&this.targetMapViews.forEach(t=>{t!==s&&(t.viewpoint=i.clone())})}))}pauseSync(){this.syncHandles.forEach(s=>{s.remove()}),this.syncHandles=[]}destroy(){this.pauseSync(),this.mainMapView=null,this.targetMapViews=[]}}exports.default=e;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import View from '@arcgis/core/views/View';
|
|
2
|
+
export default class TrafficFlow {
|
|
3
|
+
private view;
|
|
4
|
+
private mapConfig;
|
|
5
|
+
private objectsLayer;
|
|
6
|
+
private webSocket;
|
|
7
|
+
/** 交通对象最大坚持帧数(连续多少个数据包没有数据就删除) */
|
|
8
|
+
private readonly maxMissCount;
|
|
9
|
+
/** 记录每个交通对象连续多少个数据包没收到数据 */
|
|
10
|
+
private objectMissCount;
|
|
11
|
+
/** 是否显示车牌号码 */
|
|
12
|
+
private showVehiclePlate;
|
|
13
|
+
private showLog;
|
|
14
|
+
constructor(view: View);
|
|
15
|
+
/**
|
|
16
|
+
* 开始显示交通流数据
|
|
17
|
+
* @param url
|
|
18
|
+
* @param options
|
|
19
|
+
*/
|
|
20
|
+
connectTrafficFlow(url: string, options?: any): void;
|
|
21
|
+
/**
|
|
22
|
+
* 停止显示交通流数据
|
|
23
|
+
*/
|
|
24
|
+
disconnectTrafficFlow(): void;
|
|
25
|
+
/**
|
|
26
|
+
* 控制车辆号牌是否显示
|
|
27
|
+
* @param visible
|
|
28
|
+
*/
|
|
29
|
+
toggleVehiclePlate(visible: boolean): void;
|
|
30
|
+
private focusVehNo;
|
|
31
|
+
private handleTrafficFlowData;
|
|
32
|
+
/**
|
|
33
|
+
* 新增交通对象
|
|
34
|
+
* @param objects
|
|
35
|
+
*/
|
|
36
|
+
private addTrafficObjects;
|
|
37
|
+
/**
|
|
38
|
+
* 更新交通对象
|
|
39
|
+
* @param objects
|
|
40
|
+
*/
|
|
41
|
+
private updateTrafficObjects;
|
|
42
|
+
/**
|
|
43
|
+
* 基于轨迹数据创建cim符号,显示车辆图标和车牌号码
|
|
44
|
+
* @param vehTrack
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
private createCIMSymbol;
|
|
48
|
+
/**
|
|
49
|
+
* 删除交通对象
|
|
50
|
+
* @param ids
|
|
51
|
+
*/
|
|
52
|
+
private deleteTrafficObjects;
|
|
53
|
+
private buildVehicleTrackData;
|
|
54
|
+
/**
|
|
55
|
+
* 根据车身颜色属性返回对应的车辆图标
|
|
56
|
+
* @param carColor
|
|
57
|
+
* @returns
|
|
58
|
+
*/
|
|
59
|
+
private getCarPic;
|
|
60
|
+
/**
|
|
61
|
+
* 根据号牌颜色属性获取填充色和背景色
|
|
62
|
+
* @param plateColor
|
|
63
|
+
* @returns
|
|
64
|
+
*/
|
|
65
|
+
private getPlateFontColor;
|
|
66
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const p=require("@arcgis/core/Graphic"),b=require("@arcgis/core/geometry"),f=require("@arcgis/core/layers/GraphicsLayer"),y=require("../stores/index.js"),d=require("./common-utils.js");class m{constructor(o){this.maxMissCount=2,this.objectMissCount=new Map,this.showVehiclePlate=!0,this.showLog=!1,this.focusVehNo="",this.view=o;const e=y.default.useAppDataStore;this.mapConfig=JSON.parse(JSON.stringify(e.mapConfig)),this.objectsLayer=new f,this.view.map.add(this.objectsLayer)}connectTrafficFlow(o,e){var t;this.showVehiclePlate=(e==null?void 0:e.showVehiclePlate)!==!1,this.showLog=(e==null?void 0:e.showTraceLog)===!0,(t=this.webSocket)==null||t.close(),this.webSocket=new WebSocket(o),this.webSocket.onopen=()=>{console.log("websocket连接成功"),this.objectMissCount.clear()},this.webSocket.onclose=()=>{console.log("websocket连接关闭")},this.webSocket.onmessage=a=>{this.handleTrafficFlowData(a.data)}}disconnectTrafficFlow(){var o;(o=this.webSocket)==null||o.close(),this.objectsLayer.removeAll(),this.objectMissCount.clear()}toggleVehiclePlate(o){this.showVehiclePlate=o}handleTrafficFlowData(o){const e=d.default.unzip(o);if(!e)return;const t=[],a=[],n=[],l=JSON.parse(e);this.showLog&&console.log(l);const i=l.data||l.rtPositionList;if(!i||i.length===0)return;const h=new Date(l.jgsj).getTime();for(const r of i){const s=this.buildVehicleTrackData(r,h);s&&(this.objectMissCount.has(s.ptcId)?t.push(s):a.push(s),this.objectMissCount.set(s.ptcId,0))}for(const r of this.objectMissCount){const s=r[0];let c=r[1];i.findIndex(u=>u.vehno===s)<0&&(c++,this.objectMissCount.set(s,c),c===this.maxMissCount&&n.push(s))}for(const r of n)this.objectMissCount.delete(r);this.addTrafficObjects(a),this.updateTrafficObjects(t),this.deleteTrafficObjects(n)}addTrafficObjects(o){const e=o.map(t=>new p({geometry:new b.Point({longitude:t.x,latitude:t.y}),symbol:this.createCIMSymbol(t),attributes:t}));this.objectsLayer.addMany(e)}updateTrafficObjects(o){o.forEach(e=>{const t=this.objectsLayer.graphics.find(a=>a.getAttribute("ptcId")===e.ptcId);t&&(t.geometry=new b.Point({longitude:e.x,latitude:e.y}),t.symbol=this.createCIMSymbol(e))})}createCIMSymbol(o){const e=this.getPlateFontColor(o.plateColor);return{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:"$feature.showName",returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:this.showVehiclePlate,size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-8,ymin:-8,xmax:8,ymax:8},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:4,horizontalAlignment:"Center",offsetX:0,offsetY:8,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:e.backgroundColor}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:e.fillColor}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:30,rotation:o.heading,rotateClockwise:!0,textureFilter:"Picture",url:`${this.mapConfig.assetsRoot}Images/car/${this.getCarPic(o.vehicleColor).pic}`}]}}}}deleteTrafficObjects(o){o.forEach(e=>{const t=this.objectsLayer.graphics.find(a=>a.getAttribute("ptcId")===e);t&&this.objectsLayer.remove(t)})}buildVehicleTrackData(o,e){const{hpys:t,csys:a,lng:n,angle:l,hphm:i,lat:h,cx:r}=o,s=o.vehno||o.vehNo;if(!s)return;let c;if(i&&i!=="0"&&i!==0?c=i.includes("-")?i.split("-")[1]:i:c=s.includes("-")?s.split("-")[1]:s,!["1","2","3","4","5","6",1,2,3,4,5,6].includes(r)){console.log("车辆类型错误",r);return}return{ptcId:s,timestamp:e,localTimestamp:e,x:n,y:h,ptcType:Number(r),heading:l,vehicleColor:a||"z",plateColor:i?t:"99",showName:c,vehicleType:99}}getCarPic(o){if(this.view.zoom<=15)return{pic:"point.png",color:[128,128,128,255]};let e="grey",t=[128,128,128,255];switch(o.toLowerCase()){case"a":e="white",t=[200,200,200,255];break;case"b":e="grey",t=[128,128,128,255];break;case"c":e="yellow",t=[255,215,0,255];break;case"d":e="pink",t=[255,182,193,255];break;case"e":e="red",t=[255,0,0,255];break;case"f":e="purple",t=[128,0,128,255];break;case"g":e="green",t=[124,252,0,255];break;case"h":e="blue",t=[0,191,255,255];break;case"i":e="brown",t=[244,164,96,255];break;case"j":e="black",t=[0,0,0,255];break}return{pic:e+".png",color:t}}getPlateFontColor(o){let e=[255,255,255,255],t=[169,169,169,255];switch(o){case 0:e=[0,0,0,255],t=[255,255,255,255];break;case 1:e=[0,0,0,255],t=[244,164,96,255];break;case 2:e=[255,255,255,255],t=[65,105,225,255];break;case 3:e=[255,255,255,255],t=[0,0,0,255];break;case 15:e=[244,164,96,255],t=[0,250,154,255];break;case 16:e=[0,0,0,255],t=[0,250,154,255];break}return{fillColor:e,backgroundColor:t}}}exports.default=m;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './gis-map';
|
package/lib/src/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./gis-map/index.js");exports.GisMap=e.GisMap;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 路口象限,路口中心点为坐标轴原点,正北方向为0°。
|
|
3
|
+
* 225° ~ 315°:西象限。
|
|
4
|
+
* 315° ~ 45°:北象限。
|
|
5
|
+
* 45° ~ 135°:东象限。
|
|
6
|
+
* 135° ~ 225°:南象限。
|
|
7
|
+
*/
|
|
8
|
+
export declare enum QuadrantCode {
|
|
9
|
+
West = "1",
|
|
10
|
+
North = "2",
|
|
11
|
+
East = "3",
|
|
12
|
+
South = "4"
|
|
13
|
+
}
|
|
14
|
+
export interface IResult {
|
|
15
|
+
status: number;
|
|
16
|
+
message: string;
|
|
17
|
+
result?: any;
|
|
18
|
+
}
|
|
19
|
+
export interface IVehicleTrack {
|
|
20
|
+
time?: string;
|
|
21
|
+
timestamp: number;
|
|
22
|
+
localTimestamp: number;
|
|
23
|
+
crossId?: string;
|
|
24
|
+
ptcId: string;
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
ptcType: number;
|
|
28
|
+
vehicleType: number;
|
|
29
|
+
heading: number;
|
|
30
|
+
vehicleColor: number | string;
|
|
31
|
+
plateColor: number;
|
|
32
|
+
showName?: string;
|
|
33
|
+
state?: string;
|
|
34
|
+
fixAngle?: number;
|
|
35
|
+
speed?: number;
|
|
36
|
+
plateNo?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface ILaneNumberParams {
|
|
39
|
+
lanes: {
|
|
40
|
+
crossId: string;
|
|
41
|
+
laneNumber: string;
|
|
42
|
+
stopLineCenter: number[];
|
|
43
|
+
laneDirection?: number;
|
|
44
|
+
}[];
|
|
45
|
+
}
|
|
46
|
+
export interface ISetMapCenterParams {
|
|
47
|
+
center: number[];
|
|
48
|
+
camera?: {};
|
|
49
|
+
zoom?: number;
|
|
50
|
+
duration?: number;
|
|
51
|
+
}
|
|
52
|
+
export interface ILookAtParams {
|
|
53
|
+
center: number[];
|
|
54
|
+
height: number;
|
|
55
|
+
tilt?: number;
|
|
56
|
+
heading?: number;
|
|
57
|
+
duration?: number;
|
|
58
|
+
}
|
|
59
|
+
export interface IStartCrossBufferParam {
|
|
60
|
+
crossId: string;
|
|
61
|
+
crossCenter: number[];
|
|
62
|
+
bufferRadius?: number;
|
|
63
|
+
}
|
|
64
|
+
export interface IPoint {
|
|
65
|
+
type: string;
|
|
66
|
+
x: number;
|
|
67
|
+
y: number;
|
|
68
|
+
z?: number;
|
|
69
|
+
}
|
|
70
|
+
export interface ILine {
|
|
71
|
+
type: string;
|
|
72
|
+
paths: number[][][];
|
|
73
|
+
}
|
|
74
|
+
export interface IPolygon {
|
|
75
|
+
type: string;
|
|
76
|
+
rings: number[][][];
|
|
77
|
+
}
|
|
78
|
+
export interface IPointSymbol {
|
|
79
|
+
type: string;
|
|
80
|
+
style?: string;
|
|
81
|
+
url?: string;
|
|
82
|
+
width?: number;
|
|
83
|
+
height?: number;
|
|
84
|
+
horizontalOrigin?: string;
|
|
85
|
+
verticalOrigin?: string;
|
|
86
|
+
color?: string;
|
|
87
|
+
size?: number;
|
|
88
|
+
}
|
|
89
|
+
export interface ILineSymbol {
|
|
90
|
+
type: string;
|
|
91
|
+
color?: string | number[];
|
|
92
|
+
width?: number;
|
|
93
|
+
height?: number;
|
|
94
|
+
extrudeHeight?: number;
|
|
95
|
+
cornerType?: string;
|
|
96
|
+
}
|
|
97
|
+
export interface IPolygonSymbol {
|
|
98
|
+
type: string;
|
|
99
|
+
style?: string;
|
|
100
|
+
color?: string | number[];
|
|
101
|
+
outline?: {
|
|
102
|
+
color?: string | number[];
|
|
103
|
+
width?: number;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
export interface IOverlay {
|
|
107
|
+
geometry: IPoint | ILine | IPolygon;
|
|
108
|
+
id?: string;
|
|
109
|
+
visible?: boolean;
|
|
110
|
+
symbol?: IPointSymbol | ILineSymbol | IPolygonSymbol;
|
|
111
|
+
properties?: any;
|
|
112
|
+
}
|
|
113
|
+
export interface IOverlayParam {
|
|
114
|
+
type?: string;
|
|
115
|
+
defaultSymbol?: IPointSymbol | ILineSymbol | IPolygonSymbol;
|
|
116
|
+
defaultVisible?: boolean;
|
|
117
|
+
overlays: Array<IOverlay>;
|
|
118
|
+
visible?: boolean;
|
|
119
|
+
}
|
|
120
|
+
export interface ISetMapCameraParams {
|
|
121
|
+
crossId: string;
|
|
122
|
+
zoom?: number;
|
|
123
|
+
duration?: number;
|
|
124
|
+
}
|
|
125
|
+
export interface IQueueLengthParams {
|
|
126
|
+
crossNo: string;
|
|
127
|
+
laneId: number;
|
|
128
|
+
queueLength: number;
|
|
129
|
+
}
|
|
130
|
+
export interface ITraceRendererInterface {
|
|
131
|
+
addVehicles(objects: IVehicleTrack[]): void;
|
|
132
|
+
updateVehicles(objects: IVehicleTrack[]): void;
|
|
133
|
+
deleteVehicles(idList: string[]): void;
|
|
134
|
+
clearVehicles(): void;
|
|
135
|
+
updatePanelContent(contentType: EVehiclePlateState): void;
|
|
136
|
+
}
|
|
137
|
+
export declare enum EVehiclePlateState {
|
|
138
|
+
None = 0,
|
|
139
|
+
PlateNumber = 1,
|
|
140
|
+
Id = 2,
|
|
141
|
+
Mix = 3
|
|
142
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var o=(r=>(r.West="1",r.North="2",r.East="3",r.South="4",r))(o||{}),u=(r=>(r[r.None=0]="None",r[r.PlateNumber=1]="PlateNumber",r[r.Id=2]="Id",r[r.Mix=3]="Mix",r))(u||{});exports.EVehiclePlateState=u;exports.QuadrantCode=o;
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gisviewer-vue3-arcgis",
|
|
3
|
+
"version": "1.0.85",
|
|
4
|
+
"main": "lib/index.js",
|
|
5
|
+
"module": "es/index.mjs",
|
|
6
|
+
"files": [
|
|
7
|
+
"es",
|
|
8
|
+
"lib"
|
|
9
|
+
],
|
|
10
|
+
"keywords": [
|
|
11
|
+
"arcgis",
|
|
12
|
+
"vue3组件库"
|
|
13
|
+
],
|
|
14
|
+
"sideEffects": [
|
|
15
|
+
"**/*.css"
|
|
16
|
+
],
|
|
17
|
+
"author": "shi xiao qing",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"description": "",
|
|
20
|
+
"typings": "lib/index.d.ts",
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@arcgis/core": "^4.28.6",
|
|
23
|
+
"@easyest/utils": "1.0.2",
|
|
24
|
+
"@turf/area": "^6.5.0",
|
|
25
|
+
"@turf/bearing": "^6.5.0",
|
|
26
|
+
"@turf/buffer": "^6.5.0",
|
|
27
|
+
"@turf/destination": "^6.5.0",
|
|
28
|
+
"@turf/helpers": "^6.5.0",
|
|
29
|
+
"@turf/intersect": "^6.5.0",
|
|
30
|
+
"@turf/turf": "6.5.0",
|
|
31
|
+
"@types/pako": "^2.0.0",
|
|
32
|
+
"@vitest/coverage-c8": "^0.29.2",
|
|
33
|
+
"axios": "^1.4.0",
|
|
34
|
+
"pako": "^2.1.0",
|
|
35
|
+
"pinia": "^2.0.33",
|
|
36
|
+
"three": "^0.156.1",
|
|
37
|
+
"uuid": "^9.0.0",
|
|
38
|
+
"gl-matrix": "^3.4.3",
|
|
39
|
+
"pixi.js": "7.3.2"
|
|
40
|
+
}
|
|
41
|
+
}
|