@zhangdali1996/lr-map-viewer 0.0.2 → 0.0.4
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 +118 -295
- package/dist/lr-map-viewer.js +846 -841
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
# @zhangdali1996/lr-map-viewer
|
|
2
2
|
|
|
3
|
-
`@zhangdali1996/lr-map-viewer` 是面向 Vue 3
|
|
3
|
+
`@zhangdali1996/lr-map-viewer` 是面向 Vue 3 项目的三维地图组件库,提供龙软三维场景承载能力,以及基于组件实例的视角控制与模型信息查询能力。
|
|
4
4
|
|
|
5
5
|
主要能力:
|
|
6
6
|
|
|
7
|
-
- 支持 Vue 3
|
|
7
|
+
- 支持 Vue 3 项目中以组件方式挂载三维地图容器。
|
|
8
8
|
- 支持龙软三维 SDK 的运行时加载。
|
|
9
|
-
- 支持基于 `@longruan/lr-map` 的二维图纸显示。
|
|
10
9
|
- 支持通过运行时配置传入云 GIS 参数。
|
|
11
10
|
- 支持按需显示区域显隐面板和调试面板。
|
|
12
|
-
- 支持 `2d / 3d` 模式切换壳层。
|
|
13
11
|
- 支持通过组件实例调用 `moveView(x, y, z)` 移动三维视角。
|
|
14
12
|
- 支持通过组件实例注册 `registerModelInfoQuery(callback)` 查询点击模型信息。
|
|
15
13
|
|
|
@@ -53,97 +51,38 @@ public/
|
|
|
53
51
|
import { LrMapViewer } from '@zhangdali1996/lr-map-viewer'
|
|
54
52
|
|
|
55
53
|
const lr3dConfig = {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
globalNames: ['ELEMENT'],
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
// SDK 依赖的 jQuery 脚本地址
|
|
82
|
-
src: '/resource/js/jquery-3.1.1.min.js',
|
|
83
|
-
globalNames: ['jQuery', '$'],
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
},
|
|
87
|
-
scene: {
|
|
88
|
-
// 三维容器 ID,需要保证当前页面内唯一
|
|
89
|
-
containerId: 'customer-lr3d-viewer',
|
|
90
|
-
// 窗口尺寸变化时是否自动触发 resize
|
|
91
|
-
autoResize: true,
|
|
92
|
-
},
|
|
93
|
-
initOptions: {
|
|
94
|
-
// 是否显示 SDK 默认菜单
|
|
95
|
-
showMenu: false,
|
|
96
|
-
// 是否显示 SDK 默认工具栏
|
|
97
|
-
showToolbar: false,
|
|
98
|
-
// 是否显示 SDK 默认侧边栏
|
|
99
|
-
showSidebar: false,
|
|
100
|
-
// SDK 场景主题
|
|
101
|
-
theme: 'shallow',
|
|
102
|
-
// 初始 basePoint,组件内部会在加载云 GIS 数据后按地图范围重新计算
|
|
103
|
-
basePoint: { x: 0, y: 0, z: 0 },
|
|
104
|
-
},
|
|
105
|
-
dataSource: {
|
|
106
|
-
// 数据源类型,使用云 GIS 时传 cloud
|
|
107
|
-
type: 'cloud',
|
|
108
|
-
// 是否在场景初始化成功后自动加载云 GIS 数据
|
|
109
|
-
autoLoad: false,
|
|
110
|
-
// 数据加载模式,workfaceOnly 表示按工作面/区域/巷道组合加载
|
|
111
|
-
loadMode: 'workfaceOnly',
|
|
112
|
-
cloud: {
|
|
113
|
-
// 云 GIS 服务地址
|
|
114
|
-
server: '',
|
|
115
|
-
// 地图服务地址,用于获取地图元数据和范围
|
|
116
|
-
mapServerUrl: '',
|
|
117
|
-
// 云 GIS 用户名
|
|
118
|
-
username: '',
|
|
119
|
-
// 云 GIS 密码
|
|
120
|
-
password: '',
|
|
121
|
-
// 数据源 guid
|
|
122
|
-
dsGuid: '',
|
|
123
|
-
// 数据源名称
|
|
124
|
-
dsname: '',
|
|
125
|
-
laneSize: {
|
|
126
|
-
// 巷道渲染宽度
|
|
127
|
-
width: 10,
|
|
128
|
-
// 巷道渲染高度
|
|
129
|
-
height: 10,
|
|
130
|
-
},
|
|
131
|
-
// 需要加载的巷道图层名数组
|
|
132
|
-
// 不传时按服务返回结果处理,传入后会按图层名过滤
|
|
133
|
-
layers: [],
|
|
134
|
-
// 需要加载的煤层图层名数组
|
|
135
|
-
coalLayers: [],
|
|
136
|
-
// 需要加载的断层图层名数组
|
|
137
|
-
geofaultLayers: [],
|
|
138
|
-
// 工作面要素编码数组
|
|
139
|
-
workfaceFeatureTypes: ['0202030030'],
|
|
140
|
-
// 区域要素编码数组
|
|
141
|
-
regionFeatureTypes: ['0202030030', '0106020009', '0202030004', '0202030006'],
|
|
142
|
-
// 是否启用掘进辅助数据
|
|
143
|
-
enableRegionAssist: false,
|
|
144
|
-
// 是否启用巷道加载
|
|
145
|
-
enableLane: true,
|
|
54
|
+
// 是否在场景初始化成功后自动加载云 GIS 数据
|
|
55
|
+
autoLoad: true,
|
|
56
|
+
cloud: {
|
|
57
|
+
// 云 GIS 服务地址
|
|
58
|
+
server: 'https://your-cloud-gis-server/',
|
|
59
|
+
// 地图服务地址
|
|
60
|
+
mapServerUrl: 'https://your-map-server/',
|
|
61
|
+
// 云 GIS 用户名
|
|
62
|
+
username: 'your_username',
|
|
63
|
+
// 云 GIS 密码
|
|
64
|
+
password: 'your_password',
|
|
65
|
+
// 数据源 guid
|
|
66
|
+
dsGuid: 'your_ds_guid',
|
|
67
|
+
// 数据源名称
|
|
68
|
+
dsname: 'your_ds_name',
|
|
69
|
+
// 需要加载的巷道图层名
|
|
70
|
+
layers: ['your_lane_layer_name'],
|
|
71
|
+
laneSize: {
|
|
72
|
+
// 巷道渲染宽度
|
|
73
|
+
width: 10,
|
|
74
|
+
// 巷道渲染高度
|
|
75
|
+
height: 10,
|
|
146
76
|
},
|
|
77
|
+
// 需要加载的煤层图层名数组
|
|
78
|
+
coalLayers: ['your_coal_layer_name'],
|
|
79
|
+
// 需要加载的断层图层名数组
|
|
80
|
+
geofaultLayers: [],
|
|
81
|
+
// 以下开关和要素编码均提供默认值,按需覆盖即可
|
|
82
|
+
workfaceFeatureTypes: ['0202030030'],
|
|
83
|
+
regionFeatureTypes: ['0202030030', '0106020009', '0202030004', '0202030006'],
|
|
84
|
+
enableRegionAssist: false,
|
|
85
|
+
enableLane: true,
|
|
147
86
|
},
|
|
148
87
|
}
|
|
149
88
|
</script>
|
|
@@ -165,62 +104,11 @@ const lr3dConfig = {
|
|
|
165
104
|
/>
|
|
166
105
|
```
|
|
167
106
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
`2d` 模式通过传入图纸运行参数完成初始化,使用方直接提供所需配置即可。
|
|
171
|
-
|
|
172
|
-
```vue
|
|
173
|
-
<script setup>
|
|
174
|
-
import { LrMapViewer } from '@zhangdali1996/lr-map-viewer'
|
|
175
|
-
|
|
176
|
-
const map2dConfig = {
|
|
177
|
-
behavior: {
|
|
178
|
-
// 初始化后是否自动创建默认图层
|
|
179
|
-
autoInitLayer: true,
|
|
180
|
-
// 初始化后是否自动显示默认图层
|
|
181
|
-
autoShowLayer: true,
|
|
182
|
-
// 是否捕获图层树结构
|
|
183
|
-
captureLayerTree: true,
|
|
184
|
-
},
|
|
185
|
-
options: {
|
|
186
|
-
// 云 GIS 数据源 guid
|
|
187
|
-
ygis_dsGuid: 'your_ygis_ds_guid',
|
|
188
|
-
// 云 GIS 服务地址
|
|
189
|
-
ygis_url: 'https://your-cloud-gis-server/',
|
|
190
|
-
// 地图服务地址
|
|
191
|
-
Url: 'https://your-map-server/',
|
|
192
|
-
// 二维图层名称
|
|
193
|
-
layerName: 'your_layer_name',
|
|
194
|
-
// 图层编码,不需要时可留空
|
|
195
|
-
layerCode: '',
|
|
196
|
-
// 初始显示范围
|
|
197
|
-
extent: 'minX,minY,maxX,maxY',
|
|
198
|
-
// 云 GIS 用户名
|
|
199
|
-
ygis_username: 'your_username',
|
|
200
|
-
// 云 GIS 密码
|
|
201
|
-
ygis_password: 'your_password',
|
|
202
|
-
// 是否旋转视图
|
|
203
|
-
rotate: false,
|
|
204
|
-
// 是否开启平移动画
|
|
205
|
-
animate: false,
|
|
206
|
-
// 是否开启缩放动画
|
|
207
|
-
zoomAnimation: false,
|
|
208
|
-
// 是否开启 marker 缩放动画
|
|
209
|
-
markerZoomAnimation: false,
|
|
210
|
-
// 是否开启淡入淡出动画
|
|
211
|
-
fadeAnimation: false,
|
|
212
|
-
},
|
|
213
|
-
}
|
|
214
|
-
</script>
|
|
215
|
-
|
|
216
|
-
<template>
|
|
217
|
-
<div style="height: 100vh;">
|
|
218
|
-
<LrMapViewer mode="2d" :modes="['2d', '3d']" :map2d-config="map2dConfig" />
|
|
219
|
-
</div>
|
|
220
|
-
</template>
|
|
221
|
-
```
|
|
107
|
+
说明:
|
|
222
108
|
|
|
223
|
-
|
|
109
|
+
- 三维组件已内置默认的 `sdk`、`scene`、`initOptions`、`dataSource.type`、`dataSource.loadMode` 配置,通常不需要手动传入。
|
|
110
|
+
- 推荐只传 `autoLoad` 和 `cloud` 下的业务参数即可。
|
|
111
|
+
- 如果你有特殊需求,仍然可以继续传完整的 `lr3dConfig` 结构来覆盖默认值。
|
|
224
112
|
|
|
225
113
|
## 推荐接入方式
|
|
226
114
|
|
|
@@ -244,14 +132,8 @@ createApp(App).use(LrMapViewerPlugin).mount('#app')
|
|
|
244
132
|
|
|
245
133
|
组件 Props:
|
|
246
134
|
|
|
247
|
-
- `mode`
|
|
248
|
-
组件显示模式,支持 `2d` 或 `3d`。
|
|
249
|
-
- `modes`
|
|
250
|
-
当前实例允许使用的模式集合。
|
|
251
135
|
- `lr3dConfig`
|
|
252
136
|
龙软三维运行时配置。
|
|
253
|
-
- `map2dConfig`
|
|
254
|
-
二维地图运行时配置对象。
|
|
255
137
|
- `showRegionPanel`
|
|
256
138
|
是否显示区域显隐面板,默认 `false`。
|
|
257
139
|
- `showDebugPanel`
|
|
@@ -262,7 +144,6 @@ createApp(App).use(LrMapViewerPlugin).mount('#app')
|
|
|
262
144
|
- `switchMode(mode)`
|
|
263
145
|
- `getCurrentMode()`
|
|
264
146
|
- `getCurrentEngine()`
|
|
265
|
-
- `get2dInstance()`
|
|
266
147
|
- `get3dInstance()`
|
|
267
148
|
- `resize()`
|
|
268
149
|
- `refreshScene()`
|
|
@@ -271,8 +152,7 @@ createApp(App).use(LrMapViewerPlugin).mount('#app')
|
|
|
271
152
|
|
|
272
153
|
说明:
|
|
273
154
|
|
|
274
|
-
- `
|
|
275
|
-
- `refreshScene()` 仅对 `3d` 模式有效。
|
|
155
|
+
- `refreshScene()` 仅对三维场景有效。
|
|
276
156
|
- `moveView(x, y, z)` 传入的是绝对三维坐标,组件内部会自动换算成相对 `basePoint` 坐标后调用聚焦接口。
|
|
277
157
|
- `registerModelInfoQuery(callback)` 会在用户点击三维中的模型对象时触发回调。
|
|
278
158
|
- 模型信息查询返回 4 个字段:`id`、`name`、`layerName`、`position`。
|
|
@@ -346,33 +226,71 @@ watch(
|
|
|
346
226
|
|
|
347
227
|
## 云 GIS 配置说明
|
|
348
228
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
- `server`
|
|
352
|
-
- `mapServerUrl`
|
|
353
|
-
- `username`
|
|
354
|
-
- `password`
|
|
355
|
-
- `dsGuid`
|
|
356
|
-
- `dsname`
|
|
357
|
-
|
|
358
|
-
可选字段:
|
|
359
|
-
|
|
360
|
-
- `laneSize.width`
|
|
361
|
-
巷道渲染宽度,默认 `10`
|
|
362
|
-
- `laneSize.height`
|
|
363
|
-
巷道渲染高度,默认 `10`
|
|
364
|
-
|
|
365
|
-
如果开启:
|
|
229
|
+
推荐写法:
|
|
366
230
|
|
|
367
231
|
```js
|
|
368
|
-
|
|
369
|
-
autoLoad: true
|
|
232
|
+
const lr3dConfig = {
|
|
233
|
+
autoLoad: true,
|
|
234
|
+
cloud: {
|
|
235
|
+
server: 'https://your-cloud-gis-server/',
|
|
236
|
+
mapServerUrl: 'https://your-map-server/',
|
|
237
|
+
username: 'your_username',
|
|
238
|
+
password: 'your_password',
|
|
239
|
+
dsGuid: 'your_ds_guid',
|
|
240
|
+
dsname: 'your_ds_name',
|
|
241
|
+
layers: ['your_lane_layer_name'],
|
|
242
|
+
laneSize: {
|
|
243
|
+
width: 10,
|
|
244
|
+
height: 10,
|
|
245
|
+
},
|
|
246
|
+
coalLayers: ['your_coal_layer_name'],
|
|
247
|
+
geofaultLayers: [],
|
|
248
|
+
},
|
|
370
249
|
}
|
|
371
250
|
```
|
|
372
251
|
|
|
373
|
-
|
|
252
|
+
必填字段:
|
|
253
|
+
|
|
254
|
+
- `autoLoad`
|
|
255
|
+
是否在场景初始化成功后自动加载云 GIS 数据。
|
|
256
|
+
- `cloud.server`
|
|
257
|
+
云 GIS 服务地址。
|
|
258
|
+
- `cloud.mapServerUrl`
|
|
259
|
+
地图服务地址。
|
|
260
|
+
- `cloud.username`
|
|
261
|
+
云 GIS 用户名。
|
|
262
|
+
- `cloud.password`
|
|
263
|
+
云 GIS 密码。
|
|
264
|
+
- `cloud.dsGuid`
|
|
265
|
+
数据源 guid。
|
|
266
|
+
- `cloud.dsname`
|
|
267
|
+
数据源名称。
|
|
374
268
|
|
|
375
|
-
|
|
269
|
+
可选字段:
|
|
270
|
+
|
|
271
|
+
- `cloud.layers`
|
|
272
|
+
需要加载的巷道图层名数组。
|
|
273
|
+
- `cloud.laneSize.width`
|
|
274
|
+
巷道渲染宽度,默认 `10`
|
|
275
|
+
- `cloud.laneSize.height`
|
|
276
|
+
巷道渲染高度,默认 `10`
|
|
277
|
+
- `cloud.coalLayers`
|
|
278
|
+
需要加载的煤层图层名数组。
|
|
279
|
+
- `cloud.geofaultLayers`
|
|
280
|
+
需要加载的断层图层名数组。
|
|
281
|
+
- `cloud.workfaceFeatureTypes`
|
|
282
|
+
工作面要素编码数组,不传时使用默认值。
|
|
283
|
+
- `cloud.regionFeatureTypes`
|
|
284
|
+
区域要素编码数组,不传时使用默认值。
|
|
285
|
+
- `cloud.enableRegionAssist`
|
|
286
|
+
是否启用掘进辅助数据,默认 `false`。
|
|
287
|
+
- `cloud.enableLane`
|
|
288
|
+
是否启用巷道加载,默认 `true`。
|
|
289
|
+
|
|
290
|
+
兼容说明:
|
|
291
|
+
|
|
292
|
+
- 组件内部仍兼容完整的 `lr3dConfig` 写法。
|
|
293
|
+
- 如果你需要覆盖 SDK 路径、容器参数、初始化参数等高级配置,仍然可以继续传入 `sdk`、`scene`、`initOptions`、`dataSource` 完整结构。
|
|
376
294
|
|
|
377
295
|
## 示例配置
|
|
378
296
|
|
|
@@ -380,98 +298,25 @@ dataSource: {
|
|
|
380
298
|
|
|
381
299
|
```js
|
|
382
300
|
const playgroundLr3dConfig = {
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
},
|
|
396
|
-
{
|
|
397
|
-
// SDK 依赖的 Vue2 脚本地址
|
|
398
|
-
src: '/resource/js/vue.2.6.11.js',
|
|
399
|
-
globalNames: ['Vue'],
|
|
400
|
-
},
|
|
401
|
-
{
|
|
402
|
-
// SDK 依赖的 element-ui 脚本地址
|
|
403
|
-
src: '/resource/js/element_ui.js',
|
|
404
|
-
globalNames: ['ELEMENT'],
|
|
405
|
-
},
|
|
406
|
-
{
|
|
407
|
-
// SDK 依赖的 jQuery 脚本地址
|
|
408
|
-
src: '/resource/js/jquery-3.1.1.min.js',
|
|
409
|
-
globalNames: ['jQuery', '$'],
|
|
410
|
-
},
|
|
411
|
-
],
|
|
412
|
-
},
|
|
413
|
-
scene: {
|
|
414
|
-
// playground 中三维容器 ID
|
|
415
|
-
containerId: 'playground-lr3d-viewer',
|
|
416
|
-
// 窗口尺寸变化时自动触发 resize
|
|
417
|
-
autoResize: true,
|
|
418
|
-
},
|
|
419
|
-
initOptions: {
|
|
420
|
-
// 不显示 SDK 默认菜单
|
|
421
|
-
showMenu: false,
|
|
422
|
-
// 不显示 SDK 默认工具栏
|
|
423
|
-
showToolbar: false,
|
|
424
|
-
// 不显示 SDK 默认侧边栏
|
|
425
|
-
showSidebar: false,
|
|
426
|
-
// 场景主题
|
|
427
|
-
theme: 'shallow',
|
|
428
|
-
basePoint: {
|
|
429
|
-
x: 0,
|
|
430
|
-
y: 0,
|
|
431
|
-
z: 0,
|
|
432
|
-
},
|
|
433
|
-
},
|
|
434
|
-
dataSource: {
|
|
435
|
-
// 数据源类型
|
|
436
|
-
type: 'cloud',
|
|
437
|
-
// 初始化完成后自动加载云 GIS 数据
|
|
438
|
-
autoLoad: true,
|
|
439
|
-
// 按工作面模式加载
|
|
440
|
-
loadMode: 'workfaceOnly',
|
|
441
|
-
cloud: {
|
|
442
|
-
// 云 GIS 服务地址
|
|
443
|
-
server: 'https://your-cloud-gis-server/',
|
|
444
|
-
// 地图服务地址
|
|
445
|
-
mapServerUrl: 'https://your-map-server/',
|
|
446
|
-
// 云 GIS 用户名
|
|
447
|
-
username: 'your_username',
|
|
448
|
-
// 云 GIS 密码
|
|
449
|
-
password: 'your_password',
|
|
450
|
-
// 数据源 guid
|
|
451
|
-
dsGuid: 'your_ds_guid',
|
|
452
|
-
// 数据源名称
|
|
453
|
-
dsname: 'your_ds_name',
|
|
454
|
-
// 需要加载的巷道图层名
|
|
455
|
-
layers: ['your_lane_layer_name'],
|
|
456
|
-
laneSize: {
|
|
457
|
-
// 巷道宽度
|
|
458
|
-
width: 10,
|
|
459
|
-
// 巷道高度
|
|
460
|
-
height: 10,
|
|
461
|
-
},
|
|
462
|
-
// 需要加载的煤层图层名
|
|
463
|
-
coalLayers: ['your_coal_layer_name'],
|
|
464
|
-
// 需要加载的断层图层名
|
|
465
|
-
geofaultLayers: [],
|
|
466
|
-
// 工作面要素编码数组
|
|
467
|
-
workfaceFeatureTypes: ['0202030030'],
|
|
468
|
-
// 区域要素编码数组
|
|
469
|
-
regionFeatureTypes: ['0202030030', '0106020009', '0202030004', '0202030006'],
|
|
470
|
-
// 是否启用掘进辅助数据
|
|
471
|
-
enableRegionAssist: false,
|
|
472
|
-
// 是否启用巷道加载
|
|
473
|
-
enableLane: true,
|
|
301
|
+
autoLoad: true,
|
|
302
|
+
cloud: {
|
|
303
|
+
server: 'https://your-cloud-gis-server/',
|
|
304
|
+
mapServerUrl: 'https://your-map-server/',
|
|
305
|
+
username: 'your_username',
|
|
306
|
+
password: 'your_password',
|
|
307
|
+
dsGuid: 'your_ds_guid',
|
|
308
|
+
dsname: 'your_ds_name',
|
|
309
|
+
layers: ['your_lane_layer_name'],
|
|
310
|
+
laneSize: {
|
|
311
|
+
width: 10,
|
|
312
|
+
height: 10,
|
|
474
313
|
},
|
|
314
|
+
coalLayers: ['your_coal_layer_name'],
|
|
315
|
+
geofaultLayers: [],
|
|
316
|
+
workfaceFeatureTypes: ['0202030030'],
|
|
317
|
+
regionFeatureTypes: ['0202030030', '0106020009', '0202030004', '0202030006'],
|
|
318
|
+
enableRegionAssist: false,
|
|
319
|
+
enableLane: true,
|
|
475
320
|
},
|
|
476
321
|
}
|
|
477
322
|
```
|
|
@@ -490,7 +335,7 @@ const playgroundLr3dConfig = {
|
|
|
490
335
|
|
|
491
336
|
1. 确认客户项目里确实存在 `public/resource/js/jquery-3.1.1.min.js`。
|
|
492
337
|
2. 确认浏览器访问 `/resource/js/jquery-3.1.1.min.js` 返回 200,而不是 404。
|
|
493
|
-
3.
|
|
338
|
+
3. 如果资源目录不在根路径,使用完整 `lr3dConfig.sdk.dependencies` 配置覆盖默认脚本路径。
|
|
494
339
|
4. 确认 `editorapp` 与 `resource` 属于同一套 SDK 版本,不要混用不同批次文件。
|
|
495
340
|
|
|
496
341
|
### 2. 场景初始化失败:未检测到全局对象
|
|
@@ -499,7 +344,7 @@ const playgroundLr3dConfig = {
|
|
|
499
344
|
|
|
500
345
|
排查方向:
|
|
501
346
|
|
|
502
|
-
1.
|
|
347
|
+
1. 检查使用的 SDK 版本是否与组件默认配置匹配。
|
|
503
348
|
2. 检查脚本是否被浏览器拦截、跨域策略阻止,或返回了错误 HTML 页面。
|
|
504
349
|
3. 检查依赖加载顺序是否正确,前置依赖必须先于 `editorapp.bundle.js` 完成加载。
|
|
505
350
|
|
|
@@ -512,26 +357,4 @@ const playgroundLr3dConfig = {
|
|
|
512
357
|
|
|
513
358
|
处理方式:
|
|
514
359
|
|
|
515
|
-
- 在 `lr3dConfig.
|
|
516
|
-
|
|
517
|
-
### 4. 切换到 2D 后提示配置不完整
|
|
518
|
-
|
|
519
|
-
当前二维模式要求 `map2dConfig.options` 至少传入:
|
|
520
|
-
|
|
521
|
-
- `ygis_dsGuid`
|
|
522
|
-
- `ygis_url`
|
|
523
|
-
- `Url`
|
|
524
|
-
- `layerName`
|
|
525
|
-
- `token` 或 `ygis_username + ygis_password`
|
|
526
|
-
|
|
527
|
-
如果缺少这些字段,组件会直接在页面顶部提示缺失项,而不会继续初始化二维地图。
|
|
528
|
-
|
|
529
|
-
## 本地联调
|
|
530
|
-
|
|
531
|
-
在仓库根目录执行:
|
|
532
|
-
|
|
533
|
-
```bash
|
|
534
|
-
npm run dev:playground
|
|
535
|
-
```
|
|
536
|
-
|
|
537
|
-
该命令会启动示例工程 [`playground/src/App.vue`](/F:/WorkSpace/jzxy/cloud-gis-3d/playground/src/App.vue),可用于本地联调和接口验证。
|
|
360
|
+
- 在 `lr3dConfig.cloud` 中补齐实际项目所需字段。
|