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
package/README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
## 给项目设置包作用域
|
|
2
|
+
|
|
3
|
+
在应用中引入私服的包, 项目根目录下 新建文件 .npmrc 在 .npmrc 中对包源进行配置:
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
@yzc:registry=http://121.4.178.108:10023/
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
$ npm install @yzc/gisviewer-vue3-arcgis
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Using bower:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
$ bower install @yzc/gisviewer-vue3-arcgis
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Using yarn:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
$ yarn add @yzc/gisviewer-vue3-arcgis
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Using pnpm:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
$ pnpm add @yzc/gisviewer-vue3-arcgis
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 其它
|
|
34
|
+
|
|
35
|
+
可使用 nrm 管理本地 包地址
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
nrm ls
|
|
39
|
+
nrm add registry http://121.4.178.108:10023/
|
|
40
|
+
nrm use registry
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Quick Start
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
import Vue from "vue";
|
|
47
|
+
|
|
48
|
+
import gisviewerVue3Arcgis from "@yzc/gisviewer-vue3-arcgis";
|
|
49
|
+
|
|
50
|
+
const app = createApp(App);
|
|
51
|
+
|
|
52
|
+
app.use(gisviewerVue3Arcgis, {
|
|
53
|
+
openDriveServer: "http://192.168.0.205:28081/", //openDriveServer地址
|
|
54
|
+
ws: "ws://192.168.0.208:28086/", //ws 服务地址
|
|
55
|
+
assetsRoot: "http://192.168.0.205:8081/GisViewerAssets", //静态资源地址
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
app.mount("#app");
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## 使用
|
|
62
|
+
|
|
63
|
+
```js
|
|
64
|
+
<template>
|
|
65
|
+
<div class="index">
|
|
66
|
+
<gis-map :config="GIS_CONFIG_PATH" ref="gisMapRef" @map-loaded="mapLoaded"
|
|
67
|
+
@marker-click="markerClicked"></gis-map>
|
|
68
|
+
</div>
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
<script setup lang="ts">
|
|
72
|
+
import { GisMap } from "@yzc/gisviewer-vue3-arcgis";
|
|
73
|
+
|
|
74
|
+
const GIS_CONFIG_PATH: string = "./config/HuZhou/gis-config.json";
|
|
75
|
+
|
|
76
|
+
const gisMapRef = ref<InstanceType<typeof GisMap> | null>(null);
|
|
77
|
+
|
|
78
|
+
const jobId=''
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
const wshost=''
|
|
82
|
+
|
|
83
|
+
const haldclick = () => {
|
|
84
|
+
gisMapRef.value?.connectCarFlow(wshost + "crossdt-api/websocket/pw_rt_trace/" + jobId,
|
|
85
|
+
{
|
|
86
|
+
showVehiclePlate: false
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const mapLoaded=()=>{
|
|
91
|
+
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const markerClicked=()=>{
|
|
95
|
+
|
|
96
|
+
}
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<style lang="scss" scoped>
|
|
100
|
+
|
|
101
|
+
</style>
|
|
102
|
+
|
|
103
|
+
```
|
package/es/index.d.ts
ADDED
package/es/index.mjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as o from "./src/index.mjs";
|
|
2
|
+
import { default as f } from "./src/gis-map/utils/index.mjs";
|
|
3
|
+
import { GisMap as c } from "./src/gis-map/index.mjs";
|
|
4
|
+
const r = {
|
|
5
|
+
install: (s, e) => {
|
|
6
|
+
for (const i in o)
|
|
7
|
+
s.use(o[i]);
|
|
8
|
+
const { gisviewerAssetsRoot: t } = e;
|
|
9
|
+
s.config.globalProperties.$gisviewerAssetsRoot = t || "";
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
c as GisMap,
|
|
14
|
+
f as MapUtils,
|
|
15
|
+
r as default
|
|
16
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import MapView from '@arcgis/core/views/MapView';
|
|
2
|
+
import SceneView from '@arcgis/core/views/SceneView';
|
|
3
|
+
import { ILaneNumberParams, ILookAtParams, IOverlayParam, IQueueLengthParams, ISetMapCameraParams, ISetMapCenterParams, IStartCrossBufferParam } from '../types';
|
|
4
|
+
import HoloFlow from './utils/holo-flow';
|
|
5
|
+
import MapInitializer from './utils/map-initializer';
|
|
6
|
+
import OpenDriveRenderer from './utils/open-drive-renderer';
|
|
7
|
+
import Overlay from './utils/overlay';
|
|
8
|
+
import QueueLength from './utils/queue-length';
|
|
9
|
+
import RoadConfigTool from './utils/road-config-tool';
|
|
10
|
+
import TrafficFlow from './utils/traffic-flow';
|
|
11
|
+
declare const _sfc_main: import("vue").DefineComponent<{
|
|
12
|
+
config: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
assetsRoot: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
required: false;
|
|
19
|
+
};
|
|
20
|
+
}, {
|
|
21
|
+
mapContainer: any;
|
|
22
|
+
view: MapView | SceneView;
|
|
23
|
+
mapInitializer: MapInitializer;
|
|
24
|
+
roadConfigTool: RoadConfigTool;
|
|
25
|
+
trafficFlow: TrafficFlow;
|
|
26
|
+
holoFlow: HoloFlow;
|
|
27
|
+
overlay: Overlay;
|
|
28
|
+
queueLength: QueueLength;
|
|
29
|
+
openDriveRenderer: OpenDriveRenderer;
|
|
30
|
+
mapViewer: import("vue").ComputedRef<MapView | SceneView>;
|
|
31
|
+
setMapCenter: (params: ISetMapCenterParams) => Promise<import("../types").IResult>;
|
|
32
|
+
setMapCamera: (params: ISetMapCameraParams) => Promise<import("../types").IResult>;
|
|
33
|
+
lookAt: (params: ILookAtParams) => Promise<void>;
|
|
34
|
+
requestCoordinateTransform: (points: number[][], callback: (points: number[][]) => void) => {
|
|
35
|
+
handle: number;
|
|
36
|
+
points: number[][];
|
|
37
|
+
};
|
|
38
|
+
cancelCoordinateTransform: (handle: number) => void;
|
|
39
|
+
setMapZoomRange: (zoomRange: {
|
|
40
|
+
min?: number;
|
|
41
|
+
max?: number;
|
|
42
|
+
}) => void;
|
|
43
|
+
showLaneNumber: (params: ILaneNumberParams) => import("../types").IResult;
|
|
44
|
+
clearLaneNumber: () => void;
|
|
45
|
+
initializeAreaTool: (params: IStartCrossBufferParam) => Promise<import("../types").IResult>;
|
|
46
|
+
calCrossIndicatorArea: () => Promise<void>;
|
|
47
|
+
calRoadIndicatorArea: () => Promise<void>;
|
|
48
|
+
connectCarFlow: (url: string, options?: any) => Promise<void>;
|
|
49
|
+
disconnectCarFlow: () => void;
|
|
50
|
+
handleHoloVehicleTraceData: (vehicleTrace: any) => void;
|
|
51
|
+
clearHoloTrace: () => void;
|
|
52
|
+
handleHoloSignalData: (signalData: any) => Promise<void>;
|
|
53
|
+
clearHoloSignal: () => void;
|
|
54
|
+
toggleTrafficInfo: (params: {
|
|
55
|
+
name: string;
|
|
56
|
+
visible: boolean;
|
|
57
|
+
}) => void;
|
|
58
|
+
toggleVehicleInfo: (contentType: string) => void;
|
|
59
|
+
addOverlays: (params: IOverlayParam) => void;
|
|
60
|
+
removeOverlaysByType: (types: string[]) => void;
|
|
61
|
+
removeOverlaysById: (ids: string[]) => void;
|
|
62
|
+
removeAllOverlays: () => void;
|
|
63
|
+
showAllOverlays: () => void;
|
|
64
|
+
updateQueueLength: (params: IQueueLengthParams[]) => void;
|
|
65
|
+
removeQueueLength: () => void;
|
|
66
|
+
showOpenDrive: (server: string, projectName: string) => Promise<void>;
|
|
67
|
+
hideOpenDrive: () => Promise<void>;
|
|
68
|
+
props: {
|
|
69
|
+
config: string;
|
|
70
|
+
assetsRoot?: string | undefined;
|
|
71
|
+
};
|
|
72
|
+
emit: {
|
|
73
|
+
(e: 'mapLoaded'): void;
|
|
74
|
+
(e: 'markerClick', type: string, id: string, detail: any, event: any): void;
|
|
75
|
+
(e: 'mapClick', mapPoint: number[], screenPoint: number[], event: any): void;
|
|
76
|
+
};
|
|
77
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("mapLoaded" | "markerClick" | "mapClick")[], "mapLoaded" | "markerClick" | "mapClick", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
78
|
+
config: {
|
|
79
|
+
type: StringConstructor;
|
|
80
|
+
required: true;
|
|
81
|
+
};
|
|
82
|
+
assetsRoot: {
|
|
83
|
+
type: StringConstructor;
|
|
84
|
+
required: false;
|
|
85
|
+
};
|
|
86
|
+
}>> & {
|
|
87
|
+
onMapLoaded?: ((...args: any[]) => any) | undefined;
|
|
88
|
+
onMarkerClick?: ((...args: any[]) => any) | undefined;
|
|
89
|
+
onMapClick?: ((...args: any[]) => any) | undefined;
|
|
90
|
+
}, {}>;
|
|
91
|
+
export default _sfc_main;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { defineComponent as A, ref as I, onMounted as L, getCurrentInstance as D, computed as b, openBlock as M, createElementBlock as S, createElementVNode as H } from "vue";
|
|
2
|
+
import R, { registerStore as B } from "./stores/index.mjs";
|
|
3
|
+
import "./style/index.css";
|
|
4
|
+
import v from "./utils/holo-flow/index.mjs";
|
|
5
|
+
import V from "./utils/map-initializer.mjs";
|
|
6
|
+
import N from "./utils/open-drive-renderer/index.mjs";
|
|
7
|
+
import Q from "./utils/overlay.mjs";
|
|
8
|
+
import _ from "./utils/queue-length.mjs";
|
|
9
|
+
import C from "./utils/road-config-tool/index.mjs";
|
|
10
|
+
import z from "./utils/traffic-flow.mjs";
|
|
11
|
+
const x = { class: "gis-viewer" }, Ae = /* @__PURE__ */ A({
|
|
12
|
+
name: "gis-map",
|
|
13
|
+
props: {
|
|
14
|
+
config: null,
|
|
15
|
+
assetsRoot: null
|
|
16
|
+
},
|
|
17
|
+
emits: ["mapLoaded", "markerClick", "mapClick"],
|
|
18
|
+
setup(h, { expose: y, emit: m }) {
|
|
19
|
+
const w = h, p = I(null);
|
|
20
|
+
let o, s, t, r, a, n, i, l;
|
|
21
|
+
B(), L(async () => {
|
|
22
|
+
if (!p.value)
|
|
23
|
+
return;
|
|
24
|
+
const e = D(), { $gisviewerAssetsRoot: c } = e.appContext.config.globalProperties, g = await (await fetch(w.config)).json();
|
|
25
|
+
g.assetsRoot = w.assetsRoot || c;
|
|
26
|
+
const T = R.useAppDataStore;
|
|
27
|
+
T.mapConfig = g, s = new V(), o = await s.initialize({
|
|
28
|
+
container: p.value,
|
|
29
|
+
markerClickCallback: (d, u, f, k) => {
|
|
30
|
+
m("markerClick", d, u, f, k);
|
|
31
|
+
},
|
|
32
|
+
mapClickCallback: (d, u, f) => {
|
|
33
|
+
m("mapClick", d, u, f);
|
|
34
|
+
}
|
|
35
|
+
}), a = new v(o), m("mapLoaded");
|
|
36
|
+
});
|
|
37
|
+
const O = b(() => o);
|
|
38
|
+
return y({
|
|
39
|
+
mapViewer: O,
|
|
40
|
+
setMapCenter: async (e) => await s.setMapCenter(e),
|
|
41
|
+
lookAt: async (e) => await s.lookAt(e),
|
|
42
|
+
setMapCamera: async (e) => await s.setMapCamera(e),
|
|
43
|
+
setMapZoomRange: (e) => {
|
|
44
|
+
s.setMapZoomRange(e);
|
|
45
|
+
},
|
|
46
|
+
requestCoordinateTransform: (e, c) => s.requestCoordinateTransform(e, c),
|
|
47
|
+
cancelCoordinateTransform: (e) => {
|
|
48
|
+
s.cancelCoordinateTransform(e);
|
|
49
|
+
},
|
|
50
|
+
addOverlays: (e) => {
|
|
51
|
+
n || (n = new Q(o)), n.addOverlays(e);
|
|
52
|
+
},
|
|
53
|
+
showAllOverlays: () => {
|
|
54
|
+
n == null || n.showAllOverlays();
|
|
55
|
+
},
|
|
56
|
+
removeOverlaysByType: (e) => {
|
|
57
|
+
n == null || n.removeOverlaysByType(e);
|
|
58
|
+
},
|
|
59
|
+
removeOverlaysById: (e) => {
|
|
60
|
+
n == null || n.removeOverlaysById(e);
|
|
61
|
+
},
|
|
62
|
+
removeAllOverlays: () => {
|
|
63
|
+
n == null || n.removeAllOverlays();
|
|
64
|
+
},
|
|
65
|
+
showLaneNumber: (e) => (t || (t = new C(o)), t.showLaneNumber(e)),
|
|
66
|
+
clearLaneNumber: () => {
|
|
67
|
+
t == null || t.clearLaneNumber();
|
|
68
|
+
},
|
|
69
|
+
initializeAreaTool: async (e) => (t || (t = new C(o)), await t.initializeSearch(e)),
|
|
70
|
+
calCrossIndicatorArea: async () => t == null ? void 0 : t.calCrossIndicatorArea(),
|
|
71
|
+
calRoadIndicatorArea: async () => {
|
|
72
|
+
},
|
|
73
|
+
connectCarFlow: async (e, c) => {
|
|
74
|
+
r || (r = new z(o)), r.connectTrafficFlow(e, c);
|
|
75
|
+
},
|
|
76
|
+
disconnectCarFlow: () => {
|
|
77
|
+
r == null || r.disconnectTrafficFlow();
|
|
78
|
+
},
|
|
79
|
+
handleHoloVehicleTraceData: (e) => {
|
|
80
|
+
a || (a = new v(o)), a.handleVehicleTraceData(e);
|
|
81
|
+
},
|
|
82
|
+
clearHoloTrace: () => {
|
|
83
|
+
a == null || a.clearHoloTrace();
|
|
84
|
+
},
|
|
85
|
+
handleHoloSignalData: async (e) => {
|
|
86
|
+
a || (a = new v(o)), await a.handleSignalData(e);
|
|
87
|
+
},
|
|
88
|
+
clearHoloSignal: () => {
|
|
89
|
+
a == null || a.clearHoloSignal();
|
|
90
|
+
},
|
|
91
|
+
toggleTrafficInfo: (e) => {
|
|
92
|
+
switch (e.name.toLowerCase()) {
|
|
93
|
+
case "vehiclePlate".toLowerCase():
|
|
94
|
+
r == null || r.toggleVehiclePlate(e.visible);
|
|
95
|
+
break;
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
toggleVehicleInfo: (e) => {
|
|
99
|
+
a == null || a.updatePanelContent(e);
|
|
100
|
+
},
|
|
101
|
+
updateQueueLength: (e) => {
|
|
102
|
+
i || (i = new _(o)), i.updateQueueLength(e);
|
|
103
|
+
},
|
|
104
|
+
removeQueueLength: () => {
|
|
105
|
+
i == null || i.removeQueueLength();
|
|
106
|
+
},
|
|
107
|
+
showOpenDrive: async (e, c) => {
|
|
108
|
+
l || (l = new N(o)), await l.showOpenDrive(e, c);
|
|
109
|
+
},
|
|
110
|
+
hideOpenDrive: async () => {
|
|
111
|
+
await (l == null ? void 0 : l.hideOpenDrive());
|
|
112
|
+
}
|
|
113
|
+
}), (e, c) => (M(), S("div", x, [
|
|
114
|
+
H("div", {
|
|
115
|
+
class: "gis-viewer-main",
|
|
116
|
+
ref_key: "mapContainer",
|
|
117
|
+
ref: p
|
|
118
|
+
}, null, 512)
|
|
119
|
+
]));
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
export {
|
|
123
|
+
Ae as default
|
|
124
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export declare const GisMap: import("@easyest/utils/dist/lib/withinstall").SFCWithInstall<import("vue").DefineComponent<{
|
|
2
|
+
config: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
assetsRoot: {
|
|
7
|
+
type: StringConstructor;
|
|
8
|
+
required: false;
|
|
9
|
+
};
|
|
10
|
+
}, {
|
|
11
|
+
mapContainer: any;
|
|
12
|
+
view: __esri.MapView | __esri.SceneView;
|
|
13
|
+
mapInitializer: import("./utils/map-initializer").default;
|
|
14
|
+
roadConfigTool: import("./utils/road-config-tool").default;
|
|
15
|
+
trafficFlow: import("./utils/traffic-flow").default;
|
|
16
|
+
holoFlow: import("./utils/holo-flow").default;
|
|
17
|
+
overlay: import("./utils/overlay").default;
|
|
18
|
+
queueLength: import("./utils/queue-length").default;
|
|
19
|
+
openDriveRenderer: import("./utils/open-drive-renderer").default;
|
|
20
|
+
mapViewer: import("vue").ComputedRef<__esri.MapView | __esri.SceneView>;
|
|
21
|
+
setMapCenter: (params: import("../types").ISetMapCenterParams) => Promise<import("../types").IResult>;
|
|
22
|
+
setMapCamera: (params: import("../types").ISetMapCameraParams) => Promise<import("../types").IResult>;
|
|
23
|
+
lookAt: (params: import("../types").ILookAtParams) => Promise<void>;
|
|
24
|
+
requestCoordinateTransform: (points: number[][], callback: (points: number[][]) => void) => {
|
|
25
|
+
handle: number;
|
|
26
|
+
points: number[][];
|
|
27
|
+
};
|
|
28
|
+
cancelCoordinateTransform: (handle: number) => void;
|
|
29
|
+
setMapZoomRange: (zoomRange: {
|
|
30
|
+
min?: number | undefined;
|
|
31
|
+
max?: number | undefined;
|
|
32
|
+
}) => void;
|
|
33
|
+
showLaneNumber: (params: import("../types").ILaneNumberParams) => import("../types").IResult;
|
|
34
|
+
clearLaneNumber: () => void;
|
|
35
|
+
initializeAreaTool: (params: import("../types").IStartCrossBufferParam) => Promise<import("../types").IResult>;
|
|
36
|
+
calCrossIndicatorArea: () => Promise<void>;
|
|
37
|
+
calRoadIndicatorArea: () => Promise<void>;
|
|
38
|
+
connectCarFlow: (url: string, options?: any) => Promise<void>;
|
|
39
|
+
disconnectCarFlow: () => void;
|
|
40
|
+
handleHoloVehicleTraceData: (vehicleTrace: any) => void;
|
|
41
|
+
clearHoloTrace: () => void;
|
|
42
|
+
handleHoloSignalData: (signalData: any) => Promise<void>;
|
|
43
|
+
clearHoloSignal: () => void;
|
|
44
|
+
toggleTrafficInfo: (params: {
|
|
45
|
+
name: string;
|
|
46
|
+
visible: boolean;
|
|
47
|
+
}) => void;
|
|
48
|
+
toggleVehicleInfo: (contentType: string) => void;
|
|
49
|
+
addOverlays: (params: import("../types").IOverlayParam) => void;
|
|
50
|
+
removeOverlaysByType: (types: string[]) => void;
|
|
51
|
+
removeOverlaysById: (ids: string[]) => void;
|
|
52
|
+
removeAllOverlays: () => void;
|
|
53
|
+
showAllOverlays: () => void;
|
|
54
|
+
updateQueueLength: (params: import("../types").IQueueLengthParams[]) => void;
|
|
55
|
+
removeQueueLength: () => void;
|
|
56
|
+
showOpenDrive: (server: string, projectName: string) => Promise<void>;
|
|
57
|
+
hideOpenDrive: () => Promise<void>;
|
|
58
|
+
props: {
|
|
59
|
+
config: string;
|
|
60
|
+
assetsRoot?: string | undefined;
|
|
61
|
+
};
|
|
62
|
+
emit: {
|
|
63
|
+
(e: "mapLoaded"): void;
|
|
64
|
+
(e: "markerClick", type: string, id: string, detail: any, event: any): void;
|
|
65
|
+
(e: "mapClick", mapPoint: number[], screenPoint: number[], event: any): void;
|
|
66
|
+
};
|
|
67
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("mapLoaded" | "markerClick" | "mapClick")[], "mapLoaded" | "markerClick" | "mapClick", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
68
|
+
config: {
|
|
69
|
+
type: StringConstructor;
|
|
70
|
+
required: true;
|
|
71
|
+
};
|
|
72
|
+
assetsRoot: {
|
|
73
|
+
type: StringConstructor;
|
|
74
|
+
required: false;
|
|
75
|
+
};
|
|
76
|
+
}>> & {
|
|
77
|
+
onMapLoaded?: ((...args: any[]) => any) | undefined;
|
|
78
|
+
onMarkerClick?: ((...args: any[]) => any) | undefined;
|
|
79
|
+
onMapClick?: ((...args: any[]) => any) | undefined;
|
|
80
|
+
}, {}>>;
|
|
81
|
+
export default GisMap;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@import url('@arcgis/core/assets/esri/themes/dark/main.css');
|
|
2
|
+
.gis-viewer {
|
|
3
|
+
position: relative;
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 100%;
|
|
6
|
+
}
|
|
7
|
+
.gis-viewer-main {
|
|
8
|
+
width: 100%;
|
|
9
|
+
height: 100%;
|
|
10
|
+
}
|
|
11
|
+
.esri-view .esri-view-surface:focus::after {
|
|
12
|
+
outline: none !important;
|
|
13
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import MapView from '@arcgis/core/views/MapView';
|
|
2
|
+
import Extent from '@arcgis/core/geometry/Extent.js';
|
|
3
|
+
interface FlyToPointsOptions {
|
|
4
|
+
viewer: MapView;
|
|
5
|
+
points: {
|
|
6
|
+
longitude: number;
|
|
7
|
+
latitude: number;
|
|
8
|
+
}[];
|
|
9
|
+
duration?: number;
|
|
10
|
+
paddingRatio?: number;
|
|
11
|
+
onComplete?: () => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 动态点位 计算可视范围
|
|
15
|
+
*
|
|
16
|
+
* @export
|
|
17
|
+
* @class FlyToPoints
|
|
18
|
+
*/
|
|
19
|
+
export default class FlyToPoints {
|
|
20
|
+
private viewer;
|
|
21
|
+
private points;
|
|
22
|
+
constructor(options: FlyToPointsOptions);
|
|
23
|
+
/**
|
|
24
|
+
* 移动到可视角度
|
|
25
|
+
*
|
|
26
|
+
* @returns
|
|
27
|
+
* @memberof FlyToPoints
|
|
28
|
+
*/
|
|
29
|
+
flyToPoints(): void;
|
|
30
|
+
calculateZoomLevel(extent: Extent, viewWidth: number, viewHeight: number): number;
|
|
31
|
+
calculateExtent(points: string | any[]): Extent;
|
|
32
|
+
calculateCenterPoint(points: string | any[]): {
|
|
33
|
+
longitude: number;
|
|
34
|
+
latitude: number;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import c from "@arcgis/core/geometry/Extent.js";
|
|
2
|
+
class u {
|
|
3
|
+
// private duration: number;
|
|
4
|
+
constructor(t) {
|
|
5
|
+
this.viewer = t.viewer, this.points = t.points;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* 移动到可视角度
|
|
9
|
+
*
|
|
10
|
+
* @returns
|
|
11
|
+
* @memberof FlyToPoints
|
|
12
|
+
*/
|
|
13
|
+
flyToPoints() {
|
|
14
|
+
if (this.points.length == 0)
|
|
15
|
+
return;
|
|
16
|
+
const t = this.calculateExtent(this.points), n = t.center, i = Math.abs(t.xmax - t.xmin), o = Math.abs(t.ymax - t.ymin), a = 0.6, e = i * a, l = o * a, h = new c({
|
|
17
|
+
xmin: t.xmin - e,
|
|
18
|
+
ymin: t.ymin - l,
|
|
19
|
+
xmax: t.xmax + e,
|
|
20
|
+
ymax: t.ymax + l,
|
|
21
|
+
spatialReference: t.spatialReference
|
|
22
|
+
}), m = this.calculateZoomLevel(
|
|
23
|
+
h,
|
|
24
|
+
this.viewer.width,
|
|
25
|
+
this.viewer.height
|
|
26
|
+
);
|
|
27
|
+
this.viewer.goTo({
|
|
28
|
+
target: h,
|
|
29
|
+
zoom: m,
|
|
30
|
+
center: n
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
calculateZoomLevel(t, n, i) {
|
|
34
|
+
const o = Math.abs(t.xmax - t.xmin), a = Math.abs(t.ymax - t.ymin), e = Math.log2(360 * (n / o) / 256), l = Math.log2(180 * (i / a) / 256);
|
|
35
|
+
return Math.floor(Math.min(e, l));
|
|
36
|
+
}
|
|
37
|
+
calculateExtent(t) {
|
|
38
|
+
let n = Number.MAX_VALUE, i = Number.MAX_VALUE, o = Number.MIN_VALUE, a = Number.MIN_VALUE;
|
|
39
|
+
for (let e = 0; e < t.length; e++) {
|
|
40
|
+
const l = t[e];
|
|
41
|
+
n = Math.min(n, l.longitude), i = Math.min(i, l.latitude), o = Math.max(o, l.longitude), a = Math.max(a, l.latitude);
|
|
42
|
+
}
|
|
43
|
+
return new c({
|
|
44
|
+
xmin: n,
|
|
45
|
+
ymin: i,
|
|
46
|
+
xmax: o,
|
|
47
|
+
ymax: a,
|
|
48
|
+
spatialReference: {
|
|
49
|
+
wkid: 4326
|
|
50
|
+
// Assuming WGS84 spatial reference system
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
calculateCenterPoint(t) {
|
|
55
|
+
let n = 0, i = 0;
|
|
56
|
+
for (let e = 0; e < t.length; e++)
|
|
57
|
+
n += t[e].longitude, i += t[e].latitude;
|
|
58
|
+
const o = n / t.length, a = i / t.length;
|
|
59
|
+
return {
|
|
60
|
+
longitude: o,
|
|
61
|
+
latitude: a
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
u as default
|
|
67
|
+
};
|