@zhangdali1996/lr-map-viewer 0.0.169 → 1.0.1

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 CHANGED
@@ -315,7 +315,6 @@ createApp(App).use(LrMapViewerPlugin).mount('#app')
315
315
  - `initMonitorPoints()`
316
316
  - `queryMonitorPointList()`
317
317
  - `reloadMonitorPoints()`
318
- - `enterScene(sceneId)`
319
318
  - `focusMonitorPoint(target)`
320
319
  - `focusPerson(target)`
321
320
  - `movePerson(target)`
@@ -332,7 +331,6 @@ createApp(App).use(LrMapViewerPlugin).mount('#app')
332
331
  - `initMonitorPoints()` 用于初始化监测点,组件会查询监测点数据并加载显示到三维场景中。
333
332
  - `queryMonitorPointList()` 会重新查询最新监测点数据,并返回列表结果,但不会把结果重新加载到地图上。
334
333
  - `reloadMonitorPoints()` 会先清空当前场景中已加载的监测点,再重新查询并加载,避免重复添加。
335
- - `enterScene(sceneId)` 用于按场景 `id` 切换到指定场景;内部会复用现有场景进入流程,执行视角切换、监测点刷新和场景开始通知。
336
334
  - `focusMonitorPoint(target)` 会将视口移动到指定监测点,并打开该监测点的信息弹窗;`target` 支持传监测点 `id` 或监测点对象。
337
335
  - `focusPerson(target)` 用于聚焦指定人员定位对象;`target` 支持传人员 `sceneId`、人员名称或人员对象,不传时默认聚焦第一名人员。
338
336
  - `movePerson(target)` 用于查询并开始播放指定人员轨迹;`target` 的传参规则与 `focusPerson(target)` 保持一致。
@@ -391,11 +389,10 @@ createApp(App).use(LrMapViewerPlugin).mount('#app')
391
389
  - `setRangeSelection(center, options)`
392
390
  - `setRangeSelectionByCoordinate(center, options)`
393
391
  - `setRangeSelectionRadius(radius)`
394
- - `clearRangeSelection()`
395
- - `getRangeSelectionResult()`
396
- - `exportRangeSelectionPersons(options)`
397
- - `registerRangeSelectionChange(callback)`
398
- - `focusMonitorPoint(target)`
392
+ - `clearRangeSelection()`
393
+ - `getRangeSelectionResult()`
394
+ - `registerRangeSelectionChange(callback)`
395
+ - `focusMonitorPoint(target)`
399
396
 
400
397
  说明:
401
398
 
@@ -403,12 +400,11 @@ createApp(App).use(LrMapViewerPlugin).mount('#app')
403
400
  - `cancelRangeSelection(options)` 用于取消当前范围选点,可通过 `options.preserveCurrentResult` 控制是否保留当前结果。
404
401
  - `setRangeSelection(center, options)` 用于直接传入三维坐标生成球形范围,适合业务系统通过外部坐标直接驱动范围选点。
405
402
  - `setRangeSelectionByCoordinate(center, options)` 用于通过外部接口传入坐标生成球形范围,内部复用 `setRangeSelection` 的范围绘制、测点过滤和回调链路。
406
- - `setRangeSelectionRadius(radius)` 用于更新当前范围半径;如果当前已完成选点,会同步更新球体和范围内测点。
407
- - `clearRangeSelection()` 用于清除当前范围球、选点标记和测点过滤结果。
408
- - `getRangeSelectionResult()` 返回当前范围选点结果,包含状态、半径、球心坐标、当前巷道信息和范围内测点列表。
409
- - `exportRangeSelectionPersons(options)` 用于将当前范围内人员定位对象的 `name` 和 `card_id` 导出为 JSON 文件,可通过 `options.filename` 指定文件名。
410
- - `registerRangeSelectionChange(callback)` 会在开始选点、选点完成、半径变化、取消、清除时触发回调。
411
- - `focusMonitorPoint(target)` 用于定位并打开指定测点的信息窗,支持传测点 `id` 或测点对象。
403
+ - `setRangeSelectionRadius(radius)` 用于更新当前范围半径;如果当前已完成选点,会同步更新球体和范围内测点。
404
+ - `clearRangeSelection()` 用于清除当前范围球、选点标记和测点过滤结果。
405
+ - `getRangeSelectionResult()` 返回当前范围选点结果,包含状态、半径、球心坐标、当前巷道信息和范围内测点列表。
406
+ - `registerRangeSelectionChange(callback)` 会在开始选点、选点完成、半径变化、取消、清除时触发回调。
407
+ - `focusMonitorPoint(target)` 用于定位并打开指定测点的信息窗,支持传测点 `id` 或测点对象。
412
408
 
413
409
  ## 二维图纸配置说明
414
410
 
@@ -590,18 +586,14 @@ function clearRangeSelection() {
590
586
  viewerRef.value?.clearRangeSelection?.()
591
587
  }
592
588
 
593
- function focusFirstMonitorPoint() {
594
- const result = viewerRef.value?.getRangeSelectionResult?.()
595
- const firstMonitorPoint = result?.monitorPoints?.[0]
596
-
597
- if (firstMonitorPoint) {
598
- viewerRef.value?.focusMonitorPoint?.(firstMonitorPoint)
599
- }
600
- }
601
-
602
- function exportRangeSelectionPersons() {
603
- viewerRef.value?.exportRangeSelectionPersons?.()
604
- }
589
+ function focusFirstMonitorPoint() {
590
+ const result = viewerRef.value?.getRangeSelectionResult?.()
591
+ const firstMonitorPoint = result?.monitorPoints?.[0]
592
+
593
+ if (firstMonitorPoint) {
594
+ viewerRef.value?.focusMonitorPoint?.(firstMonitorPoint)
595
+ }
596
+ }
605
597
 
606
598
  watch(
607
599
  viewerRef,
@@ -621,13 +613,12 @@ watch(
621
613
  <template>
622
614
  <div style="height: 100vh;">
623
615
  <button type="button" @click="startRangeSelection">开始范围选点</button>
624
- <button type="button" @click="setRangeSelectionByCoordinate">按坐标生成范围</button>
625
- <button type="button" @click="clearRangeSelection">清除范围</button>
626
- <button type="button" @click="focusFirstMonitorPoint">定位首个测点</button>
627
- <button type="button" @click="exportRangeSelectionPersons">导出范围人员</button>
628
- <LrMapViewer ref="viewerRef" :lr3d-config="lr3dConfig" />
629
- </div>
630
- </template>
616
+ <button type="button" @click="setRangeSelectionByCoordinate">按坐标生成范围</button>
617
+ <button type="button" @click="clearRangeSelection">清除范围</button>
618
+ <button type="button" @click="focusFirstMonitorPoint">定位首个测点</button>
619
+ <LrMapViewer ref="viewerRef" :lr3d-config="lr3dConfig" />
620
+ </div>
621
+ </template>
631
622
  ```
632
623
 
633
624
  如果你需要切换二维与三维模式: