leiting-bim 2.1.36 → 2.1.39
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/leiting-bim.es.js +1 -1
- package/leiting-bim.umd.js +11 -11
- package/leitingbim.css +1 -1
- package/package.json +1 -1
- package/plugins/.gitmodules +4 -0
- package/plugins/README.md +2 -0
- package/plugins/build.cjs +63 -0
- package/plugins/cesium-core/dist/cesium-core.mjs +6217 -0
- package/plugins/cesium-core/dist/cesium-core.umd.js +76 -0
- package/plugins/cesium-core/dist/components/BufferedHierarchicalAggregator.d.ts +73 -0
- package/plugins/cesium-core/dist/components/HtmlOverlayLabelPool.d.ts +152 -0
- package/plugins/cesium-core/dist/components/MarkerEvent.d.ts +38 -0
- package/plugins/cesium-core/dist/components/Material/MaterialManager.d.ts +49 -0
- package/plugins/cesium-core/dist/components/Material/help/PolylineFlowMaterialProperty.d.ts +10 -0
- package/plugins/cesium-core/dist/components/Material/help/dynamicImgMaterial.d.ts +16 -0
- package/plugins/cesium-core/dist/components/Material/index.d.ts +3 -0
- package/plugins/cesium-core/dist/components/TooltipManager.d.ts +11 -0
- package/plugins/cesium-core/dist/components/draw/DrawTool.d.ts +10 -0
- package/plugins/cesium-core/dist/components/draw/handlers/CircleDrawer.d.ts +16 -0
- package/plugins/cesium-core/dist/components/draw/handlers/LineDrawer.d.ts +14 -0
- package/plugins/cesium-core/dist/components/draw/handlers/PointDrawer.d.ts +12 -0
- package/plugins/cesium-core/dist/components/draw/handlers/PolygonDrawer.d.ts +14 -0
- package/plugins/cesium-core/dist/components/draw/handlers/RectangleDrawer.d.ts +13 -0
- package/plugins/cesium-core/dist/components/draw/types.d.ts +29 -0
- package/plugins/cesium-core/dist/components/entity/EntityLayer.d.ts +65 -0
- package/plugins/cesium-core/dist/components/gltf/GLTFManage.d.ts +141 -0
- package/plugins/cesium-core/dist/components/gltf/index.d.ts +1 -0
- package/plugins/cesium-core/dist/components/measurement/MeasurementTool.d.ts +34 -0
- package/plugins/cesium-core/dist/components/measurement/handlers/AreaMeasure.d.ts +28 -0
- package/plugins/cesium-core/dist/components/measurement/handlers/CircleMeasure.d.ts +22 -0
- package/plugins/cesium-core/dist/components/measurement/handlers/CoordinateMeasure.d.ts +16 -0
- package/plugins/cesium-core/dist/components/measurement/handlers/HorizontalMeasure.d.ts +27 -0
- package/plugins/cesium-core/dist/components/measurement/handlers/PolylineDistanceMeasure.d.ts +25 -0
- package/plugins/cesium-core/dist/components/measurement/handlers/RectangleMeasure.d.ts +30 -0
- package/plugins/cesium-core/dist/components/measurement/handlers/RegularPolygonMeasure.d.ts +28 -0
- package/plugins/cesium-core/dist/components/measurement/handlers/SpaceMeasure.d.ts +21 -0
- package/plugins/cesium-core/dist/components/measurement/handlers/TerrainHeightMeasure.d.ts +18 -0
- package/plugins/cesium-core/dist/components/measurement/handlers/TriangleMeasure.d.ts +30 -0
- package/plugins/cesium-core/dist/components/measurement/handlers/VerticalMeasure.d.ts +23 -0
- package/plugins/cesium-core/dist/components/measurement/index.d.ts +13 -0
- package/plugins/cesium-core/dist/components/measurement/types.d.ts +42 -0
- package/plugins/cesium-core/dist/components/primitive/PrimitiveManager.d.ts +50 -0
- package/plugins/cesium-core/dist/components/roaming/CameraRoamTool.d.ts +27 -0
- package/plugins/cesium-core/dist/components/roaming/PathRoamTool.d.ts +23 -0
- package/plugins/cesium-core/dist/components/roaming/index.d.ts +3 -0
- package/plugins/cesium-core/dist/components/roaming/types.d.ts +66 -0
- package/plugins/cesium-core/dist/components/utils/convertGeoJsonToEntityData.d.ts +1 -0
- package/plugins/cesium-core/dist/components/utils/uuid.d.ts +1 -0
- package/plugins/cesium-core/dist/index.d.ts +12 -0
- package/plugins/cesium-core/package.json +27 -0
- package/plugins/cesium-core/pnpm-lock.yaml +872 -0
- package/plugins/cesium-core/src/components/BufferedHierarchicalAggregator.ts +546 -0
- package/plugins/cesium-core/src/components/HtmlOverlayLabelPool.ts +489 -0
- package/plugins/cesium-core/src/components/MarkerEvent.ts +92 -0
- package/plugins/cesium-core/src/components/Material/MaterialManager.ts +129 -0
- package/plugins/cesium-core/src/components/Material/help/PolylineFlowMaterialProperty.ts +116 -0
- package/plugins/cesium-core/src/components/Material/help/dynamicImgMaterial.ts +236 -0
- package/plugins/cesium-core/src/components/Material/index.ts +3 -0
- package/plugins/cesium-core/src/components/TooltipManager.ts +52 -0
- package/plugins/cesium-core/src/components/draw/DrawTool.ts +55 -0
- package/plugins/cesium-core/src/components/draw/handlers/CircleDrawer.ts +159 -0
- package/plugins/cesium-core/src/components/draw/handlers/LineDrawer.ts +113 -0
- package/plugins/cesium-core/src/components/draw/handlers/PointDrawer.ts +70 -0
- package/plugins/cesium-core/src/components/draw/handlers/PolygonDrawer.ts +112 -0
- package/plugins/cesium-core/src/components/draw/handlers/RectangleDrawer.ts +115 -0
- package/plugins/cesium-core/src/components/draw/types.ts +28 -0
- package/plugins/cesium-core/src/components/entity/EntityLayer.ts +453 -0
- package/plugins/cesium-core/src/components/gltf/GLTFManage.ts +799 -0
- package/plugins/cesium-core/src/components/gltf/index.ts +1 -0
- package/plugins/cesium-core/src/components/measurement/MeasurementTool.ts +416 -0
- package/plugins/cesium-core/src/components/measurement/handlers/AreaMeasure.ts +552 -0
- package/plugins/cesium-core/src/components/measurement/handlers/CircleMeasure.ts +289 -0
- package/plugins/cesium-core/src/components/measurement/handlers/CoordinateMeasure.ts +139 -0
- package/plugins/cesium-core/src/components/measurement/handlers/HorizontalMeasure.ts +427 -0
- package/plugins/cesium-core/src/components/measurement/handlers/PolylineDistanceMeasure.ts +356 -0
- package/plugins/cesium-core/src/components/measurement/handlers/RectangleMeasure.ts +516 -0
- package/plugins/cesium-core/src/components/measurement/handlers/RegularPolygonMeasure.ts +472 -0
- package/plugins/cesium-core/src/components/measurement/handlers/SpaceMeasure.ts +250 -0
- package/plugins/cesium-core/src/components/measurement/handlers/TerrainHeightMeasure.ts +185 -0
- package/plugins/cesium-core/src/components/measurement/handlers/TriangleMeasure.ts +561 -0
- package/plugins/cesium-core/src/components/measurement/handlers/VerticalMeasure.ts +361 -0
- package/plugins/cesium-core/src/components/measurement/index.ts +13 -0
- package/plugins/cesium-core/src/components/measurement/types.ts +57 -0
- package/plugins/cesium-core/src/components/primitive/PrimitiveManager.ts +556 -0
- package/plugins/cesium-core/src/components/roaming/CameraRoamTool.ts +286 -0
- package/plugins/cesium-core/src/components/roaming/PathRoamTool.ts +174 -0
- package/plugins/cesium-core/src/components/roaming/index.ts +3 -0
- package/plugins/cesium-core/src/components/roaming/types.ts +71 -0
- package/plugins/cesium-core/src/components/utils/convertGeoJsonToEntityData.ts +98 -0
- package/plugins/cesium-core/src/components/utils/uuid.ts +7 -0
- package/plugins/cesium-core/src/index.ts +17 -0
- package/plugins/cesium-core/src/test/measurement/index.html +166 -0
- package/plugins/cesium-core/src/test/roaming/c.gltf +1 -0
- package/plugins/cesium-core/src/test/roaming/f87cc3ea918a4b76bff2c88a3655eb1f.bin +0 -0
- package/plugins/cesium-core/src/test/roaming/index.html +51 -0
- package/plugins/cesium-core/src/test/roaming/path.html +448 -0
- package/plugins/cesium-core/src/test/roaming/view.html +520 -0
- package/plugins/cesium-core/stats.html +4949 -0
- package/plugins/cesium-core/tsconfig.json +14 -0
- package/plugins/cesium-core/vite.config.ts +35 -0
- package/plugins/cesium-vue/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
- package/plugins/cesium-vue/dist/components/basic-audio/index.d.ts +13 -0
- package/plugins/cesium-vue/dist/components/basic-audio.d.ts +6 -0
- package/plugins/cesium-vue/dist/components/basic-audio.js +1295 -0
- package/plugins/cesium-vue/dist/components/basic-video/index.d.ts +98 -0
- package/plugins/cesium-vue/dist/components/basic-video.d.ts +6 -0
- package/plugins/cesium-vue/dist/components/basic-video.js +67 -0
- package/plugins/cesium-vue/dist/components/card-carousel/index.d.ts +147 -0
- package/plugins/cesium-vue/dist/components/card-carousel.d.ts +6 -0
- package/plugins/cesium-vue/dist/components/card-carousel.js +143 -0
- package/plugins/cesium-vue/dist/components/card-content/index.d.ts +16 -0
- package/plugins/cesium-vue/dist/components/card-content.d.ts +6 -0
- package/plugins/cesium-vue/dist/components/card-content.js +74 -0
- package/plugins/cesium-vue/dist/components/card-page/index.d.ts +64 -0
- package/plugins/cesium-vue/dist/components/card-page.d.ts +6 -0
- package/plugins/cesium-vue/dist/components/card-page.js +111 -0
- package/plugins/cesium-vue/dist/components/carousel-img/index.d.ts +34 -0
- package/plugins/cesium-vue/dist/components/carousel-img.d.ts +6 -0
- package/plugins/cesium-vue/dist/components/carousel-img.js +72 -0
- package/plugins/cesium-vue/dist/components/echarts-pro/index.d.ts +63 -0
- package/plugins/cesium-vue/dist/components/echarts-pro.d.ts +6 -0
- package/plugins/cesium-vue/dist/components/echarts-pro.js +7 -0
- package/plugins/cesium-vue/dist/components/marker-bubble/index.d.ts +73 -0
- package/plugins/cesium-vue/dist/components/marker-bubble.d.ts +6 -0
- package/plugins/cesium-vue/dist/components/marker-bubble.js +123 -0
- package/plugins/cesium-vue/dist/components/marker-default/index.d.ts +43 -0
- package/plugins/cesium-vue/dist/components/marker-default.d.ts +6 -0
- package/plugins/cesium-vue/dist/components/marker-default.js +39 -0
- package/plugins/cesium-vue/dist/components/marker-html/index.d.ts +43 -0
- package/plugins/cesium-vue/dist/components/marker-html.d.ts +6 -0
- package/plugins/cesium-vue/dist/components/marker-html.js +40 -0
- package/plugins/cesium-vue/dist/components/marker-manage/index.d.ts +159 -0
- package/plugins/cesium-vue/dist/components/marker-manage.d.ts +6 -0
- package/plugins/cesium-vue/dist/components/marker-manage.js +896 -0
- package/plugins/cesium-vue/dist/components/marker-text/index.d.ts +25 -0
- package/plugins/cesium-vue/dist/components/marker-text.d.ts +6 -0
- package/plugins/cesium-vue/dist/components/marker-text.js +30 -0
- package/plugins/cesium-vue/dist/components/measurement/index.d.ts +73 -0
- package/plugins/cesium-vue/dist/components/measurement.d.ts +6 -0
- package/plugins/cesium-vue/dist/components/measurement.js +170 -0
- package/plugins/cesium-vue/dist/create-DynflqE1.js +31 -0
- package/plugins/cesium-vue/dist/index-B03tSn8_.js +45855 -0
- package/plugins/cesium-vue/dist/index-CUs_hd1V.js +403 -0
- package/plugins/cesium-vue/dist/index.d.ts +44 -0
- package/plugins/cesium-vue/dist/index.js +82 -0
- package/plugins/cesium-vue/package.json +106 -0
- package/plugins/cesium-vue/src/assets/icons/icon-001.png +0 -0
- package/plugins/cesium-vue/src/assets/icons/icon-002.png +0 -0
- package/plugins/cesium-vue/src/assets/icons/icon-003.png +0 -0
- package/plugins/cesium-vue/src/assets/icons/icon-004.png +0 -0
- package/plugins/cesium-vue/src/assets/icons/icon-005.png +0 -0
- package/plugins/cesium-vue/src/assets/icons/icon-006.png +0 -0
- package/plugins/cesium-vue/src/assets/icons/icon-007.png +0 -0
- package/plugins/cesium-vue/src/assets/icons/icon-008.png +0 -0
- package/plugins/cesium-vue/src/assets/icons/icon-009.png +0 -0
- package/plugins/cesium-vue/src/assets/icons/icon-010.png +0 -0
- package/plugins/cesium-vue/src/assets/icons/icon-011.png +0 -0
- package/plugins/cesium-vue/src/assets/icons/icon-012.png +0 -0
- package/plugins/cesium-vue/src/assets/img/Card3-BG.png +0 -0
- package/plugins/cesium-vue/src/assets/img/card_bg3.png +0 -0
- package/plugins/cesium-vue/src/components/basic-audio/index.ts +6 -0
- package/plugins/cesium-vue/src/components/basic-audio/src/BasicAudio.vue +119 -0
- package/plugins/cesium-vue/src/components/basic-audio/src/basicAudio.ts +6 -0
- package/plugins/cesium-vue/src/components/basic-video/index.ts +7 -0
- package/plugins/cesium-vue/src/components/basic-video/src/BasicVideo.vue +58 -0
- package/plugins/cesium-vue/src/components/basic-video/src/basicVideo.ts +14 -0
- package/plugins/cesium-vue/src/components/card-carousel/index.ts +7 -0
- package/plugins/cesium-vue/src/components/card-carousel/src/CardCarousel.vue +124 -0
- package/plugins/cesium-vue/src/components/card-carousel/src/cardCarousel.ts +60 -0
- package/plugins/cesium-vue/src/components/card-content/index.ts +7 -0
- package/plugins/cesium-vue/src/components/card-content/src/CardContent.vue +41 -0
- package/plugins/cesium-vue/src/components/card-content/src/cardContent.ts +22 -0
- package/plugins/cesium-vue/src/components/card-page/index.ts +7 -0
- package/plugins/cesium-vue/src/components/card-page/src/CardPage.vue +102 -0
- package/plugins/cesium-vue/src/components/card-page/src/cardPage.ts +37 -0
- package/plugins/cesium-vue/src/components/carousel-img/index.ts +7 -0
- package/plugins/cesium-vue/src/components/carousel-img/src/CarouselImg.vue +84 -0
- package/plugins/cesium-vue/src/components/carousel-img/src/carouselImg.ts +8 -0
- package/plugins/cesium-vue/src/components/echarts-pro/index.ts +7 -0
- package/plugins/cesium-vue/src/components/echarts-pro/src/EchartsPro.vue +107 -0
- package/plugins/cesium-vue/src/components/echarts-pro/src/echartsPro.ts +12 -0
- package/plugins/cesium-vue/src/components/echarts-pro/src/hook/useECharts.ts +55 -0
- package/plugins/cesium-vue/src/components/marker-bubble/index.ts +7 -0
- package/plugins/cesium-vue/src/components/marker-bubble/src/MarkerBubble.vue +235 -0
- package/plugins/cesium-vue/src/components/marker-bubble/src/markerBubble.ts +35 -0
- package/plugins/cesium-vue/src/components/marker-default/index.ts +7 -0
- package/plugins/cesium-vue/src/components/marker-default/src/MarkerDefault.vue +19 -0
- package/plugins/cesium-vue/src/components/marker-default/src/markerDefault.ts +12 -0
- package/plugins/cesium-vue/src/components/marker-html/index.ts +7 -0
- package/plugins/cesium-vue/src/components/marker-html/src/MarkerHtml.vue +21 -0
- package/plugins/cesium-vue/src/components/marker-html/src/markerHtml.ts +12 -0
- package/plugins/cesium-vue/src/components/marker-manage/index.ts +9 -0
- package/plugins/cesium-vue/src/components/marker-manage/src/components/MarkerManage.vue +106 -0
- package/plugins/cesium-vue/src/components/marker-manage/src/config/theme.ts +8 -0
- package/plugins/cesium-vue/src/components/marker-manage/src/core/MarkerManage.ts +466 -0
- package/plugins/cesium-vue/src/components/marker-manage/src/core/MarkerManagerCore.ts +148 -0
- package/plugins/cesium-vue/src/components/marker-manage/src/hook/useMarkerManage.ts +45 -0
- package/plugins/cesium-vue/src/components/marker-manage/src/type/markerManage.ts +75 -0
- package/plugins/cesium-vue/src/components/marker-manage/src/utils/themeTool.ts +154 -0
- package/plugins/cesium-vue/src/components/marker-text/index.ts +7 -0
- package/plugins/cesium-vue/src/components/marker-text/src/MarkerText.vue +14 -0
- package/plugins/cesium-vue/src/components/marker-text/src/markerText.ts +10 -0
- package/plugins/cesium-vue/src/components/measurement/index.ts +7 -0
- package/plugins/cesium-vue/src/components/measurement/src/Measurement.vue +183 -0
- package/plugins/cesium-vue/src/components/measurement/src/measurement.ts +20 -0
- package/plugins/cesium-vue/src/index.ts +89 -0
- package/plugins/cesium-vue/stats.html +4949 -0
- package/plugins/cesium-vue/tsconfig.json +18 -0
- package/plugins/cesium-vue/vite.config.ts +62 -0
- package/plugins/plugins/README.md +2 -0
- package/plugins/plugins/build.cjs +63 -0
- package/plugins/plugins/cesium-core/dist/cesium-core.mjs +5881 -0
- package/plugins/plugins/cesium-core/dist/cesium-core.mjs.map +1 -0
- package/plugins/plugins/cesium-core/dist/cesium-core.umd.js +77 -0
- package/plugins/plugins/cesium-core/dist/cesium-core.umd.js.map +1 -0
- package/plugins/plugins/cesium-core/dist/components/BufferedHierarchicalAggregator.d.ts +73 -0
- package/plugins/plugins/cesium-core/dist/components/HtmlOverlayLabelPool.d.ts +152 -0
- package/plugins/plugins/cesium-core/dist/components/MarkerEvent.d.ts +38 -0
- package/plugins/plugins/cesium-core/dist/components/Material/MaterialManager.d.ts +49 -0
- package/plugins/plugins/cesium-core/dist/components/Material/help/PolylineFlowMaterialProperty.d.ts +10 -0
- package/plugins/plugins/cesium-core/dist/components/Material/help/dynamicImgMaterial.d.ts +16 -0
- package/plugins/plugins/cesium-core/dist/components/Material/index.d.ts +3 -0
- package/plugins/plugins/cesium-core/dist/components/TooltipManager.d.ts +11 -0
- package/plugins/plugins/cesium-core/dist/components/draw/DrawTool.d.ts +10 -0
- package/plugins/plugins/cesium-core/dist/components/draw/handlers/CircleDrawer.d.ts +16 -0
- package/plugins/plugins/cesium-core/dist/components/draw/handlers/LineDrawer.d.ts +14 -0
- package/plugins/plugins/cesium-core/dist/components/draw/handlers/PointDrawer.d.ts +12 -0
- package/plugins/plugins/cesium-core/dist/components/draw/handlers/PolygonDrawer.d.ts +14 -0
- package/plugins/plugins/cesium-core/dist/components/draw/handlers/RectangleDrawer.d.ts +13 -0
- package/plugins/plugins/cesium-core/dist/components/draw/types.d.ts +29 -0
- package/plugins/plugins/cesium-core/dist/components/entity/EntityLayer.d.ts +65 -0
- package/plugins/plugins/cesium-core/dist/components/gltf/GLTFManage.d.ts +141 -0
- package/plugins/plugins/cesium-core/dist/components/gltf/index.d.ts +1 -0
- package/plugins/plugins/cesium-core/dist/components/measurement/MeasurementTool.d.ts +34 -0
- package/plugins/plugins/cesium-core/dist/components/measurement/handlers/AreaMeasure.d.ts +23 -0
- package/plugins/plugins/cesium-core/dist/components/measurement/handlers/CircleMeasure.d.ts +21 -0
- package/plugins/plugins/cesium-core/dist/components/measurement/handlers/CoordinateMeasure.d.ts +16 -0
- package/plugins/plugins/cesium-core/dist/components/measurement/handlers/HorizontalMeasure.d.ts +25 -0
- package/plugins/plugins/cesium-core/dist/components/measurement/handlers/PolylineDistanceMeasure.d.ts +24 -0
- package/plugins/plugins/cesium-core/dist/components/measurement/handlers/RectangleMeasure.d.ts +22 -0
- package/plugins/plugins/cesium-core/dist/components/measurement/handlers/RegularPolygonMeasure.d.ts +23 -0
- package/plugins/plugins/cesium-core/dist/components/measurement/handlers/SpaceMeasure.d.ts +20 -0
- package/plugins/plugins/cesium-core/dist/components/measurement/handlers/TerrainHeightMeasure.d.ts +18 -0
- package/plugins/plugins/cesium-core/dist/components/measurement/handlers/TriangleMeasure.d.ts +24 -0
- package/plugins/plugins/cesium-core/dist/components/measurement/handlers/VerticalMeasure.d.ts +23 -0
- package/plugins/plugins/cesium-core/dist/components/measurement/index.d.ts +13 -0
- package/plugins/plugins/cesium-core/dist/components/measurement/types.d.ts +42 -0
- package/plugins/plugins/cesium-core/dist/components/primitive/PrimitiveManager.d.ts +50 -0
- package/plugins/plugins/cesium-core/dist/components/roaming/CameraRoamTool.d.ts +27 -0
- package/plugins/plugins/cesium-core/dist/components/roaming/PathRoamTool.d.ts +23 -0
- package/plugins/plugins/cesium-core/dist/components/roaming/index.d.ts +3 -0
- package/plugins/plugins/cesium-core/dist/components/roaming/types.d.ts +66 -0
- package/plugins/plugins/cesium-core/dist/components/utils/convertGeoJsonToEntityData.d.ts +1 -0
- package/plugins/plugins/cesium-core/dist/components/utils/uuid.d.ts +1 -0
- package/plugins/plugins/cesium-core/dist/index.d.ts +12 -0
- package/plugins/plugins/cesium-core/package.json +26 -0
- package/plugins/plugins/cesium-core/pnpm-lock.yaml +872 -0
- package/plugins/plugins/cesium-core/src/components/BufferedHierarchicalAggregator.ts +546 -0
- package/plugins/plugins/cesium-core/src/components/HtmlOverlayLabelPool.ts +489 -0
- package/plugins/plugins/cesium-core/src/components/MarkerEvent.ts +92 -0
- package/plugins/plugins/cesium-core/src/components/Material/MaterialManager.ts +129 -0
- package/plugins/plugins/cesium-core/src/components/Material/help/PolylineFlowMaterialProperty.ts +116 -0
- package/plugins/plugins/cesium-core/src/components/Material/help/dynamicImgMaterial.ts +236 -0
- package/plugins/plugins/cesium-core/src/components/Material/index.ts +3 -0
- package/plugins/plugins/cesium-core/src/components/TooltipManager.ts +52 -0
- package/plugins/plugins/cesium-core/src/components/draw/DrawTool.ts +55 -0
- package/plugins/plugins/cesium-core/src/components/draw/handlers/CircleDrawer.ts +159 -0
- package/plugins/plugins/cesium-core/src/components/draw/handlers/LineDrawer.ts +113 -0
- package/plugins/plugins/cesium-core/src/components/draw/handlers/PointDrawer.ts +70 -0
- package/plugins/plugins/cesium-core/src/components/draw/handlers/PolygonDrawer.ts +112 -0
- package/plugins/plugins/cesium-core/src/components/draw/handlers/RectangleDrawer.ts +115 -0
- package/plugins/plugins/cesium-core/src/components/draw/types.ts +28 -0
- package/plugins/plugins/cesium-core/src/components/entity/EntityLayer.ts +453 -0
- package/plugins/plugins/cesium-core/src/components/gltf/GLTFManage.ts +799 -0
- package/plugins/plugins/cesium-core/src/components/gltf/index.ts +1 -0
- package/plugins/plugins/cesium-core/src/components/measurement/MeasurementTool.ts +416 -0
- package/plugins/plugins/cesium-core/src/components/measurement/handlers/AreaMeasure.ts +451 -0
- package/plugins/plugins/cesium-core/src/components/measurement/handlers/CircleMeasure.ts +267 -0
- package/plugins/plugins/cesium-core/src/components/measurement/handlers/CoordinateMeasure.ts +139 -0
- package/plugins/plugins/cesium-core/src/components/measurement/handlers/HorizontalMeasure.ts +418 -0
- package/plugins/plugins/cesium-core/src/components/measurement/handlers/PolylineDistanceMeasure.ts +352 -0
- package/plugins/plugins/cesium-core/src/components/measurement/handlers/RectangleMeasure.ts +388 -0
- package/plugins/plugins/cesium-core/src/components/measurement/handlers/RegularPolygonMeasure.ts +379 -0
- package/plugins/plugins/cesium-core/src/components/measurement/handlers/SpaceMeasure.ts +246 -0
- package/plugins/plugins/cesium-core/src/components/measurement/handlers/TerrainHeightMeasure.ts +185 -0
- package/plugins/plugins/cesium-core/src/components/measurement/handlers/TriangleMeasure.ts +541 -0
- package/plugins/plugins/cesium-core/src/components/measurement/handlers/VerticalMeasure.ts +360 -0
- package/plugins/plugins/cesium-core/src/components/measurement/index.ts +13 -0
- package/plugins/plugins/cesium-core/src/components/measurement/types.ts +57 -0
- package/plugins/plugins/cesium-core/src/components/primitive/PrimitiveManager.ts +556 -0
- package/plugins/plugins/cesium-core/src/components/roaming/CameraRoamTool.ts +286 -0
- package/plugins/plugins/cesium-core/src/components/roaming/PathRoamTool.ts +174 -0
- package/plugins/plugins/cesium-core/src/components/roaming/index.ts +3 -0
- package/plugins/plugins/cesium-core/src/components/roaming/types.ts +71 -0
- package/plugins/plugins/cesium-core/src/components/utils/convertGeoJsonToEntityData.ts +98 -0
- package/plugins/plugins/cesium-core/src/components/utils/uuid.ts +7 -0
- package/plugins/plugins/cesium-core/src/index.ts +17 -0
- package/plugins/plugins/cesium-core/src/test/measurement/index.html +166 -0
- package/plugins/plugins/cesium-core/src/test/roaming/c.gltf +1 -0
- package/plugins/plugins/cesium-core/src/test/roaming/f87cc3ea918a4b76bff2c88a3655eb1f.bin +0 -0
- package/plugins/plugins/cesium-core/src/test/roaming/index.html +51 -0
- package/plugins/plugins/cesium-core/src/test/roaming/path.html +448 -0
- package/plugins/plugins/cesium-core/src/test/roaming/view.html +520 -0
- package/plugins/plugins/cesium-core/stats.html +4949 -0
- package/plugins/plugins/cesium-core/tsconfig.json +14 -0
- package/plugins/plugins/cesium-core/vite.config.ts +35 -0
- package/plugins/plugins/cesium-vue/dist/components/basic-audio/index.d.ts +18 -0
- package/plugins/plugins/cesium-vue/dist/components/basic-audio/index.d.ts.map +1 -0
- package/plugins/plugins/cesium-vue/dist/components/basic-video/index.d.ts +92 -0
- package/plugins/plugins/cesium-vue/dist/components/basic-video/index.d.ts.map +1 -0
- package/plugins/plugins/cesium-vue/dist/components/camera-roam/index.d.ts +82 -0
- package/plugins/plugins/cesium-vue/dist/components/camera-roam/index.d.ts.map +1 -0
- package/plugins/plugins/cesium-vue/dist/components/card-carousel/index.d.ts +152 -0
- package/plugins/plugins/cesium-vue/dist/components/card-carousel/index.d.ts.map +1 -0
- package/plugins/plugins/cesium-vue/dist/components/card-content/index.d.ts +21 -0
- package/plugins/plugins/cesium-vue/dist/components/card-content/index.d.ts.map +1 -0
- package/plugins/plugins/cesium-vue/dist/components/card-page/index.d.ts +69 -0
- package/plugins/plugins/cesium-vue/dist/components/card-page/index.d.ts.map +1 -0
- package/plugins/plugins/cesium-vue/dist/components/carousel-img/index.d.ts +21 -0
- package/plugins/plugins/cesium-vue/dist/components/carousel-img/index.d.ts.map +1 -0
- package/plugins/plugins/cesium-vue/dist/components/echarts-pro/index.d.ts +68 -0
- package/plugins/plugins/cesium-vue/dist/components/echarts-pro/index.d.ts.map +1 -0
- package/plugins/plugins/cesium-vue/dist/components/marker-bubble/index.d.ts +78 -0
- package/plugins/plugins/cesium-vue/dist/components/marker-bubble/index.d.ts.map +1 -0
- package/plugins/plugins/cesium-vue/dist/components/marker-default/index.d.ts +48 -0
- package/plugins/plugins/cesium-vue/dist/components/marker-default/index.d.ts.map +1 -0
- package/plugins/plugins/cesium-vue/dist/components/marker-html/index.d.ts +48 -0
- package/plugins/plugins/cesium-vue/dist/components/marker-html/index.d.ts.map +1 -0
- package/plugins/plugins/cesium-vue/dist/components/marker-manage/index.d.ts +164 -0
- package/plugins/plugins/cesium-vue/dist/components/marker-manage/index.d.ts.map +1 -0
- package/plugins/plugins/cesium-vue/dist/components/marker-text/index.d.ts +30 -0
- package/plugins/plugins/cesium-vue/dist/components/marker-text/index.d.ts.map +1 -0
- package/plugins/plugins/cesium-vue/dist/components/measurement/index.d.ts +78 -0
- package/plugins/plugins/cesium-vue/dist/components/measurement/index.d.ts.map +1 -0
- package/plugins/plugins/cesium-vue/dist/components/path-roam/index.d.ts +82 -0
- package/plugins/plugins/cesium-vue/dist/components/path-roam/index.d.ts.map +1 -0
- package/plugins/plugins/cesium-vue/dist/components/test/index.d.ts +67 -0
- package/plugins/plugins/cesium-vue/dist/components/test/index.d.ts.map +1 -0
- package/plugins/plugins/cesium-vue/dist/index.css +1 -0
- package/plugins/plugins/cesium-vue/dist/index.d.ts +30 -0
- package/plugins/plugins/cesium-vue/dist/index.d.ts.map +1 -0
- package/plugins/plugins/cesium-vue/dist/index.js +10087 -0
- package/plugins/plugins/cesium-vue/dist/index.js.map +1 -0
- package/plugins/plugins/cesium-vue/dist/index.umd.cjs +46 -0
- package/plugins/plugins/cesium-vue/dist/index.umd.cjs.map +1 -0
- package/plugins/plugins/cesium-vue/package.json +48 -0
- package/plugins/plugins/cesium-vue/src/assets/icons/icon-001.png +0 -0
- package/plugins/plugins/cesium-vue/src/assets/icons/icon-002.png +0 -0
- package/plugins/plugins/cesium-vue/src/assets/icons/icon-003.png +0 -0
- package/plugins/plugins/cesium-vue/src/assets/icons/icon-004.png +0 -0
- package/plugins/plugins/cesium-vue/src/assets/icons/icon-005.png +0 -0
- package/plugins/plugins/cesium-vue/src/assets/icons/icon-006.png +0 -0
- package/plugins/plugins/cesium-vue/src/assets/icons/icon-007.png +0 -0
- package/plugins/plugins/cesium-vue/src/assets/icons/icon-008.png +0 -0
- package/plugins/plugins/cesium-vue/src/assets/icons/icon-009.png +0 -0
- package/plugins/plugins/cesium-vue/src/assets/icons/icon-010.png +0 -0
- package/plugins/plugins/cesium-vue/src/assets/icons/icon-011.png +0 -0
- package/plugins/plugins/cesium-vue/src/assets/icons/icon-012.png +0 -0
- package/plugins/plugins/cesium-vue/src/assets/img/Card3-BG.png +0 -0
- package/plugins/plugins/cesium-vue/src/assets/img/card_bg3.png +0 -0
- package/plugins/plugins/cesium-vue/src/components/basic-audio/index.ts +11 -0
- package/plugins/plugins/cesium-vue/src/components/basic-audio/src/BasicAudio.vue +110 -0
- package/plugins/plugins/cesium-vue/src/components/basic-audio/src/basicAudio.ts +6 -0
- package/plugins/plugins/cesium-vue/src/components/basic-video/index.ts +12 -0
- package/plugins/plugins/cesium-vue/src/components/basic-video/src/BasicVideo.vue +99 -0
- package/plugins/plugins/cesium-vue/src/components/basic-video/src/basicVideo.ts +13 -0
- package/plugins/plugins/cesium-vue/src/components/camera-roam/index.ts +4 -0
- package/plugins/plugins/cesium-vue/src/components/camera-roam/src/CameraRoam.vue +434 -0
- package/plugins/plugins/cesium-vue/src/components/camera-roam/src/cameraRoam.ts +28 -0
- package/plugins/plugins/cesium-vue/src/components/card-carousel/index.ts +12 -0
- package/plugins/plugins/cesium-vue/src/components/card-carousel/src/CardCarousel.vue +124 -0
- package/plugins/plugins/cesium-vue/src/components/card-carousel/src/cardCarousel.ts +60 -0
- package/plugins/plugins/cesium-vue/src/components/card-content/index.ts +12 -0
- package/plugins/plugins/cesium-vue/src/components/card-content/src/CardContent.vue +41 -0
- package/plugins/plugins/cesium-vue/src/components/card-content/src/cardContent.ts +22 -0
- package/plugins/plugins/cesium-vue/src/components/card-page/index.ts +12 -0
- package/plugins/plugins/cesium-vue/src/components/card-page/src/CardPage.vue +102 -0
- package/plugins/plugins/cesium-vue/src/components/card-page/src/cardPage.ts +37 -0
- package/plugins/plugins/cesium-vue/src/components/carousel-img/index.ts +12 -0
- package/plugins/plugins/cesium-vue/src/components/carousel-img/src/CarouselImg.vue +15 -0
- package/plugins/plugins/cesium-vue/src/components/carousel-img/src/carouselImg.ts +6 -0
- package/plugins/plugins/cesium-vue/src/components/echarts-pro/index.ts +12 -0
- package/plugins/plugins/cesium-vue/src/components/echarts-pro/src/EchartsPro.vue +107 -0
- package/plugins/plugins/cesium-vue/src/components/echarts-pro/src/echartsPro.ts +12 -0
- package/plugins/plugins/cesium-vue/src/components/echarts-pro/src/hook/useECharts.ts +55 -0
- package/plugins/plugins/cesium-vue/src/components/marker-bubble/index.ts +12 -0
- package/plugins/plugins/cesium-vue/src/components/marker-bubble/src/MarkerBubble.vue +235 -0
- package/plugins/plugins/cesium-vue/src/components/marker-bubble/src/markerBubble.ts +35 -0
- package/plugins/plugins/cesium-vue/src/components/marker-default/index.ts +12 -0
- package/plugins/plugins/cesium-vue/src/components/marker-default/src/MarkerDefault.vue +19 -0
- package/plugins/plugins/cesium-vue/src/components/marker-default/src/markerDefault.ts +12 -0
- package/plugins/plugins/cesium-vue/src/components/marker-html/index.ts +12 -0
- package/plugins/plugins/cesium-vue/src/components/marker-html/src/MarkerHtml.vue +21 -0
- package/plugins/plugins/cesium-vue/src/components/marker-html/src/markerHtml.ts +12 -0
- package/plugins/plugins/cesium-vue/src/components/marker-manage/index.ts +14 -0
- package/plugins/plugins/cesium-vue/src/components/marker-manage/src/components/MarkerManage.vue +106 -0
- package/plugins/plugins/cesium-vue/src/components/marker-manage/src/config/theme.ts +8 -0
- package/plugins/plugins/cesium-vue/src/components/marker-manage/src/core/MarkerManage.ts +466 -0
- package/plugins/plugins/cesium-vue/src/components/marker-manage/src/core/MarkerManagerCore.ts +148 -0
- package/plugins/plugins/cesium-vue/src/components/marker-manage/src/hook/useMarkerManage.ts +45 -0
- package/plugins/plugins/cesium-vue/src/components/marker-manage/src/type/markerManage.ts +75 -0
- package/plugins/plugins/cesium-vue/src/components/marker-manage/src/utils/themeTool.ts +154 -0
- package/plugins/plugins/cesium-vue/src/components/marker-text/index.ts +12 -0
- package/plugins/plugins/cesium-vue/src/components/marker-text/src/MarkerText.vue +14 -0
- package/plugins/plugins/cesium-vue/src/components/marker-text/src/markerText.ts +10 -0
- package/plugins/plugins/cesium-vue/src/components/measurement/index.ts +12 -0
- package/plugins/plugins/cesium-vue/src/components/measurement/src/Measurement.vue +183 -0
- package/plugins/plugins/cesium-vue/src/components/measurement/src/measurement.ts +20 -0
- package/plugins/plugins/cesium-vue/src/components/path-roam/index.ts +4 -0
- package/plugins/plugins/cesium-vue/src/components/path-roam/src/PathRoam.vue +429 -0
- package/plugins/plugins/cesium-vue/src/components/path-roam/src/pathRoam.ts +28 -0
- package/plugins/plugins/cesium-vue/src/components/test/CardMarker.vue +150 -0
- package/plugins/plugins/cesium-vue/src/components/test/CesiumMarker.vue +34 -0
- package/plugins/plugins/cesium-vue/src/components/test/CesiumViewer.vue +77 -0
- package/plugins/plugins/cesium-vue/src/components/test/MyLabel.vue +25 -0
- package/plugins/plugins/cesium-vue/src/components/test/index.ts +28 -0
- package/plugins/plugins/cesium-vue/src/index.ts +83 -0
- package/plugins/plugins/cesium-vue/stats.html +4949 -0
- package/plugins/plugins/cesium-vue/tsconfig.json +18 -0
- package/plugins/plugins/cesium-vue/vite.config.ts +56 -0
- package/plugins/plugins/theme-chalk/dist/theme-chalk.css +819 -0
- package/plugins/plugins/theme-chalk/index.less +11 -0
- package/plugins/plugins/theme-chalk/package.json +27 -0
- package/plugins/plugins/theme-chalk/src/basicAudio.less +41 -0
- package/plugins/plugins/theme-chalk/src/basicVideo.less +17 -0
- package/plugins/plugins/theme-chalk/src/cameraRoam.less +239 -0
- package/plugins/plugins/theme-chalk/src/cardCarousel.less +71 -0
- package/plugins/plugins/theme-chalk/src/cardContent.less +73 -0
- package/plugins/plugins/theme-chalk/src/cardPage.less +61 -0
- package/plugins/plugins/theme-chalk/src/carouselImg.less +34 -0
- package/plugins/plugins/theme-chalk/src/marker.less +107 -0
- package/plugins/plugins/theme-chalk/src/markerManage.less +25 -0
- package/plugins/plugins/theme-chalk/src/measurement.less +106 -0
- package/plugins/plugins/theme-chalk/src/mixins/config.less +4 -0
- package/plugins/plugins/theme-chalk/src/mixins/mixins.less +64 -0
- package/plugins/plugins/theme-chalk/src/pathRoam.less +198 -0
- package/plugins/plugins/utils/create.ts +45 -0
- package/plugins/plugins/utils/package.json +12 -0
- package/plugins/plugins/utils/uuid.ts +43 -0
- package/plugins/plugins/utils/with-install.ts +10 -0
- package/plugins/theme-chalk/dist/theme-chalk.css +852 -0
- package/plugins/theme-chalk/index.less +11 -0
- package/plugins/theme-chalk/package.json +27 -0
- package/plugins/theme-chalk/src/basicAudio.less +44 -0
- package/plugins/theme-chalk/src/basicVideo.less +17 -0
- package/plugins/theme-chalk/src/cameraRoam.less +239 -0
- package/plugins/theme-chalk/src/cardCarousel.less +71 -0
- package/plugins/theme-chalk/src/cardContent.less +73 -0
- package/plugins/theme-chalk/src/cardPage.less +61 -0
- package/plugins/theme-chalk/src/carouselImg.less +66 -0
- package/plugins/theme-chalk/src/marker.less +107 -0
- package/plugins/theme-chalk/src/markerManage.less +25 -0
- package/plugins/theme-chalk/src/measurement.less +106 -0
- package/plugins/theme-chalk/src/mixins/config.less +4 -0
- package/plugins/theme-chalk/src/mixins/mixins.less +64 -0
- package/plugins/theme-chalk/src/pathRoam.less +198 -0
- package/plugins/utils/create.ts +45 -0
- package/plugins/utils/package.json +12 -0
- package/plugins/utils/uuid.ts +43 -0
- package/plugins/utils/with-install.ts +10 -0
|
@@ -0,0 +1,561 @@
|
|
|
1
|
+
import { IMeasure, MeasurementOptions, MeasurementRecord } from '../types';
|
|
2
|
+
import { HtmlOverlayLabelPool } from '../../HtmlOverlayLabelPool';
|
|
3
|
+
|
|
4
|
+
export default class TriangleMeasure implements IMeasure {
|
|
5
|
+
private Cesium: any;
|
|
6
|
+
private viewer: any;
|
|
7
|
+
private handler: any = null;
|
|
8
|
+
private positions: any[] = [];
|
|
9
|
+
private htmlLabelPool: any = null;
|
|
10
|
+
private htmlLabelId: string | null = null;
|
|
11
|
+
private segmentEntities: any[] = [];
|
|
12
|
+
private angleMarkerEntities: any[] = [];
|
|
13
|
+
private pointEntities: any[] = [];
|
|
14
|
+
private segmentLabelIds: string[] = [];
|
|
15
|
+
private angleLabelIds: string[] = [];
|
|
16
|
+
private previewLabelId: string | null = null;
|
|
17
|
+
private previewSegmentEntities: any[] = [];
|
|
18
|
+
private previewAngleMarkerEntities: any[] = [];
|
|
19
|
+
private previewPointEntity: any = null;
|
|
20
|
+
private previewLow: any = null;
|
|
21
|
+
private previewHigh: any = null;
|
|
22
|
+
private previewThird: any = null;
|
|
23
|
+
private previewMarkerP1: any = null;
|
|
24
|
+
private previewMarkerP2: any = null;
|
|
25
|
+
private previewMarkerCorner: any = null;
|
|
26
|
+
|
|
27
|
+
constructor(Cesium: any, viewer: any) {
|
|
28
|
+
this.Cesium = Cesium;
|
|
29
|
+
this.viewer = viewer;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
start(options: MeasurementOptions) {
|
|
33
|
+
this.clear();
|
|
34
|
+
const Cesium = this.Cesium;
|
|
35
|
+
const viewer = this.viewer;
|
|
36
|
+
if (!this.htmlLabelPool) {
|
|
37
|
+
const containerId = options.overlayContainerId || 'html-label-container';
|
|
38
|
+
this.htmlLabelPool = new HtmlOverlayLabelPool(Cesium, viewer, containerId);
|
|
39
|
+
this.htmlLabelPool.registerTheme('measure-triangle', {
|
|
40
|
+
createElement: (el: HTMLDivElement, ctx: any) => {
|
|
41
|
+
el.innerHTML = String(ctx?.data?.text || '');
|
|
42
|
+
el.style.background = 'rgba(0,0,0,0.6)';
|
|
43
|
+
el.style.color = '#fff';
|
|
44
|
+
el.style.font = '14px sans-serif';
|
|
45
|
+
el.style.padding = '4px 6px';
|
|
46
|
+
el.style.borderRadius = '4px';
|
|
47
|
+
el.style.whiteSpace = 'pre';
|
|
48
|
+
},
|
|
49
|
+
options: { offset: { x: 0, y: -10 } },
|
|
50
|
+
});
|
|
51
|
+
this.htmlLabelPool.registerTheme('measure-triangle-seg', {
|
|
52
|
+
createElement: (el: HTMLDivElement, ctx: any) => {
|
|
53
|
+
el.innerHTML = String(ctx?.data?.text || '');
|
|
54
|
+
el.style.background = 'rgba(0,0,0,0.6)';
|
|
55
|
+
el.style.color = '#fff';
|
|
56
|
+
el.style.font = '14px sans-serif';
|
|
57
|
+
el.style.padding = '4px 6px';
|
|
58
|
+
el.style.borderRadius = '4px';
|
|
59
|
+
el.style.whiteSpace = 'pre';
|
|
60
|
+
},
|
|
61
|
+
options: { offset: { x: 0, y: -10 } },
|
|
62
|
+
});
|
|
63
|
+
this.htmlLabelPool.registerTheme('measure-triangle-angle', {
|
|
64
|
+
createElement: (el: HTMLDivElement, ctx: any) => {
|
|
65
|
+
el.innerHTML = String(ctx?.data?.text || '');
|
|
66
|
+
el.style.background = 'rgba(0,0,0,0.6)';
|
|
67
|
+
el.style.color = '#fff';
|
|
68
|
+
el.style.font = '14px sans-serif';
|
|
69
|
+
el.style.padding = '4px 6px';
|
|
70
|
+
el.style.borderRadius = '4px';
|
|
71
|
+
el.style.whiteSpace = 'pre';
|
|
72
|
+
},
|
|
73
|
+
options: { offset: { x: 0, y: -10 } },
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
this.handler = new Cesium.ScreenSpaceEventHandler(viewer.canvas);
|
|
77
|
+
this.handler.setInputAction((movement: any) => {
|
|
78
|
+
const pos = viewer.scene.pickPosition(movement.position);
|
|
79
|
+
if (!pos) return;
|
|
80
|
+
this.positions.push(pos);
|
|
81
|
+
const p = viewer.entities.add({
|
|
82
|
+
position: pos,
|
|
83
|
+
point: {
|
|
84
|
+
pixelSize: 8,
|
|
85
|
+
color: options.pointColor || options.color || Cesium.Color.YELLOW,
|
|
86
|
+
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
this.pointEntities.push(p);
|
|
90
|
+
if (this.positions.length === 2) {
|
|
91
|
+
this.stop();
|
|
92
|
+
this.previewSegmentEntities.forEach((e) => viewer.entities.remove(e));
|
|
93
|
+
this.previewSegmentEntities = [];
|
|
94
|
+
this.previewAngleMarkerEntities.forEach((e) => viewer.entities.remove(e));
|
|
95
|
+
this.previewAngleMarkerEntities = [];
|
|
96
|
+
if (this.previewPointEntity) {
|
|
97
|
+
viewer.entities.remove(this.previewPointEntity);
|
|
98
|
+
this.previewPointEntity = null;
|
|
99
|
+
}
|
|
100
|
+
const c1 = Cesium.Cartographic.fromCartesian(this.positions[0]);
|
|
101
|
+
const c2 = Cesium.Cartographic.fromCartesian(this.positions[1]);
|
|
102
|
+
const h1 = c1.height || 0;
|
|
103
|
+
const h2 = c2.height || 0;
|
|
104
|
+
const low = h1 <= h2 ? this.positions[0] : this.positions[1];
|
|
105
|
+
const high = h1 > h2 ? this.positions[0] : this.positions[1];
|
|
106
|
+
const cl = Cesium.Cartographic.fromCartesian(low);
|
|
107
|
+
const ch = Cesium.Cartographic.fromCartesian(high);
|
|
108
|
+
const maxH = Math.max(h1, h2);
|
|
109
|
+
const third = Cesium.Cartesian3.fromDegrees(
|
|
110
|
+
Cesium.Math.toDegrees(cl.longitude),
|
|
111
|
+
Cesium.Math.toDegrees(cl.latitude),
|
|
112
|
+
maxH,
|
|
113
|
+
);
|
|
114
|
+
const solidColor = options.lineColor || options.color || Cesium.Color.YELLOW;
|
|
115
|
+
const dashColor = (options.dashLineColor || options.lineColor || options.color || Cesium.Color.RED).withAlpha?.(0.9) || Cesium.Color.RED;
|
|
116
|
+
const vertical = viewer.entities.add({
|
|
117
|
+
polyline: {
|
|
118
|
+
positions: [low, third],
|
|
119
|
+
width: options.width || 3,
|
|
120
|
+
material: solidColor,
|
|
121
|
+
depthFailMaterial: new Cesium.PolylineDashMaterialProperty({ color: dashColor, dashLength: 12, dashPattern: 255 }),
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
const horizontal = viewer.entities.add({
|
|
125
|
+
polyline: {
|
|
126
|
+
positions: [third, high],
|
|
127
|
+
width: options.width || 3,
|
|
128
|
+
material: solidColor,
|
|
129
|
+
depthFailMaterial: new Cesium.PolylineDashMaterialProperty({ color: dashColor, dashLength: 12, dashPattern: 255 }),
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
const hypotenuse = viewer.entities.add({
|
|
133
|
+
polyline: {
|
|
134
|
+
positions: [low, high],
|
|
135
|
+
width: options.width || 3,
|
|
136
|
+
material: solidColor,
|
|
137
|
+
depthFailMaterial: new Cesium.PolylineDashMaterialProperty({ color: dashColor, dashLength: 12, dashPattern: 255 }),
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
this.segmentEntities.push(vertical, horizontal, hypotenuse);
|
|
141
|
+
const lenV = Cesium.Cartesian3.distance(low, third);
|
|
142
|
+
const lenH = Cesium.Cartesian3.distance(third, high);
|
|
143
|
+
const lenHyp = Cesium.Cartesian3.distance(low, high);
|
|
144
|
+
const midV = new Cesium.Cartesian3((low.x + third.x) / 2, (low.y + third.y) / 2, (low.z + third.z) / 2);
|
|
145
|
+
const midH = new Cesium.Cartesian3((third.x + high.x) / 2, (third.y + high.y) / 2, (third.z + high.z) / 2);
|
|
146
|
+
const midHyp = new Cesium.Cartesian3((low.x + high.x) / 2, (low.y + high.y) / 2, (low.z + high.z) / 2);
|
|
147
|
+
const mV = Cesium.Cartographic.fromCartesian(midV);
|
|
148
|
+
const mH = Cesium.Cartographic.fromCartesian(midH);
|
|
149
|
+
const mHyp = Cesium.Cartographic.fromCartesian(midHyp);
|
|
150
|
+
const idV = 'measure_triangle_seg_v';
|
|
151
|
+
const idH = 'measure_triangle_seg_h';
|
|
152
|
+
const idHyp = 'measure_triangle_seg_hyp';
|
|
153
|
+
this.segmentLabelIds = [idV, idH, idHyp];
|
|
154
|
+
this.htmlLabelPool.add({ text: `${lenV.toFixed(2)} m` }, { id: idV, lon: Cesium.Math.toDegrees(mV.longitude), lat: Cesium.Math.toDegrees(mV.latitude), height: mV.height || 0, theme: 'measure-triangle-seg', show: true, style: { pointerEvents: 'none', userSelect: 'none', cursor: 'default' } });
|
|
155
|
+
this.htmlLabelPool.add({ text: `${lenH.toFixed(2)} m` }, { id: idH, lon: Cesium.Math.toDegrees(mH.longitude), lat: Cesium.Math.toDegrees(mH.latitude), height: mH.height || 0, theme: 'measure-triangle-seg', show: true, style: { pointerEvents: 'none', userSelect: 'none', cursor: 'default' } });
|
|
156
|
+
this.htmlLabelPool.add({ text: `${lenHyp.toFixed(2)} m` }, { id: idHyp, lon: Cesium.Math.toDegrees(mHyp.longitude), lat: Cesium.Math.toDegrees(mHyp.latitude), height: mHyp.height || 0, theme: 'measure-triangle-seg', show: true, style: { pointerEvents: 'none', userSelect: 'none', cursor: 'default' } });
|
|
157
|
+
const vLowToHigh = Cesium.Cartesian3.subtract(high, low, new Cesium.Cartesian3());
|
|
158
|
+
const vLowToThird = Cesium.Cartesian3.subtract(third, low, new Cesium.Cartesian3());
|
|
159
|
+
const vHighToThird = Cesium.Cartesian3.subtract(third, high, new Cesium.Cartesian3());
|
|
160
|
+
const vHighToLow = Cesium.Cartesian3.subtract(low, high, new Cesium.Cartesian3());
|
|
161
|
+
const dotA = Cesium.Cartesian3.dot(vLowToHigh, vLowToThird);
|
|
162
|
+
const magA = Math.sqrt(Cesium.Cartesian3.dot(vLowToHigh, vLowToHigh)) * Math.sqrt(Cesium.Cartesian3.dot(vLowToThird, vLowToThird));
|
|
163
|
+
const dotB = Cesium.Cartesian3.dot(vHighToThird, vHighToLow);
|
|
164
|
+
const magB = Math.sqrt(Cesium.Cartesian3.dot(vHighToThird, vHighToThird)) * Math.sqrt(Cesium.Cartesian3.dot(vHighToLow, vHighToLow));
|
|
165
|
+
const angleA = Math.acos(Math.min(Math.max(dotA / (magA || 1), -1), 1));
|
|
166
|
+
const angleB = Math.acos(Math.min(Math.max(dotB / (magB || 1), -1), 1));
|
|
167
|
+
const cLow = Cesium.Cartographic.fromCartesian(low);
|
|
168
|
+
const cHigh = Cesium.Cartographic.fromCartesian(high);
|
|
169
|
+
const idAngA = 'measure_triangle_angle_a';
|
|
170
|
+
const idAngB = 'measure_triangle_angle_b';
|
|
171
|
+
this.angleLabelIds = [idAngA, idAngB];
|
|
172
|
+
this.htmlLabelPool.add({ text: `${(angleA * 180 / Math.PI).toFixed(2)}°` }, { id: idAngA, lon: Cesium.Math.toDegrees(cLow.longitude), lat: Cesium.Math.toDegrees(cLow.latitude), height: cLow.height || 0, theme: 'measure-triangle-angle', show: true, style: { pointerEvents: 'none', userSelect: 'none', cursor: 'default' } });
|
|
173
|
+
this.htmlLabelPool.add({ text: `${(angleB * 180 / Math.PI).toFixed(2)}°` }, { id: idAngB, lon: Cesium.Math.toDegrees(cHigh.longitude), lat: Cesium.Math.toDegrees(cHigh.latitude), height: cHigh.height || 0, theme: 'measure-triangle-angle', show: true, style: { pointerEvents: 'none', userSelect: 'none', cursor: 'default' } });
|
|
174
|
+
const ratio = Math.max(0.01, Math.min(0.5, options.angleMarkerRatio ?? 0.2));
|
|
175
|
+
const markerLen = Math.min(lenV, lenH) * ratio;
|
|
176
|
+
if (lenV > 0.001 && lenH > 0.001) {
|
|
177
|
+
const dirV = Cesium.Cartesian3.normalize(
|
|
178
|
+
Cesium.Cartesian3.subtract(low, third, new Cesium.Cartesian3()),
|
|
179
|
+
new Cesium.Cartesian3(),
|
|
180
|
+
);
|
|
181
|
+
const dirH = Cesium.Cartesian3.normalize(
|
|
182
|
+
Cesium.Cartesian3.subtract(high, third, new Cesium.Cartesian3()),
|
|
183
|
+
new Cesium.Cartesian3(),
|
|
184
|
+
);
|
|
185
|
+
const pOffV = new Cesium.Cartesian3(
|
|
186
|
+
third.x + dirV.x * markerLen,
|
|
187
|
+
third.y + dirV.y * markerLen,
|
|
188
|
+
third.z + dirV.z * markerLen,
|
|
189
|
+
);
|
|
190
|
+
const pOffH = new Cesium.Cartesian3(
|
|
191
|
+
third.x + dirH.x * markerLen,
|
|
192
|
+
third.y + dirH.y * markerLen,
|
|
193
|
+
third.z + dirH.z * markerLen,
|
|
194
|
+
);
|
|
195
|
+
const pCorner = new Cesium.Cartesian3(
|
|
196
|
+
third.x + dirV.x * markerLen + dirH.x * markerLen,
|
|
197
|
+
third.y + dirV.y * markerLen + dirH.y * markerLen,
|
|
198
|
+
third.z + dirV.z * markerLen + dirH.z * markerLen,
|
|
199
|
+
);
|
|
200
|
+
const rightMarkerSeg1 = viewer.entities.add({
|
|
201
|
+
polyline: {
|
|
202
|
+
positions: [pOffV, pCorner],
|
|
203
|
+
width: options.width || 3,
|
|
204
|
+
material: solidColor,
|
|
205
|
+
depthFailMaterial: new Cesium.PolylineDashMaterialProperty({ color: dashColor, dashLength: 12, dashPattern: 255 }),
|
|
206
|
+
},
|
|
207
|
+
});
|
|
208
|
+
const rightMarkerSeg2 = viewer.entities.add({
|
|
209
|
+
polyline: {
|
|
210
|
+
positions: [pOffH, pCorner],
|
|
211
|
+
width: options.width || 3,
|
|
212
|
+
material: solidColor,
|
|
213
|
+
depthFailMaterial: new Cesium.PolylineDashMaterialProperty({ color: dashColor, dashLength: 12, dashPattern: 255 }),
|
|
214
|
+
},
|
|
215
|
+
});
|
|
216
|
+
this.angleMarkerEntities.push(rightMarkerSeg1, rightMarkerSeg2);
|
|
217
|
+
}
|
|
218
|
+
if (this.previewLabelId && this.htmlLabelPool) {
|
|
219
|
+
this.htmlLabelPool.removeByIds([this.previewLabelId]);
|
|
220
|
+
this.previewLabelId = null;
|
|
221
|
+
}
|
|
222
|
+
const result = {
|
|
223
|
+
entity: this.segmentEntities,
|
|
224
|
+
positions: [low, high, third],
|
|
225
|
+
lengths: { vertical: lenV, horizontal: lenH, hypotenuse: lenHyp },
|
|
226
|
+
angles: { acuteA: angleA, acuteB: angleB },
|
|
227
|
+
clear: () => this.clear(),
|
|
228
|
+
};
|
|
229
|
+
options.onComplete?.(result);
|
|
230
|
+
}
|
|
231
|
+
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
|
232
|
+
this.handler.setInputAction((movement: any) => {
|
|
233
|
+
if (this.positions.length !== 1) return;
|
|
234
|
+
const pos = viewer.scene.pickPosition(movement.endPosition);
|
|
235
|
+
if (!pos) return;
|
|
236
|
+
const c1 = Cesium.Cartographic.fromCartesian(this.positions[0]);
|
|
237
|
+
const c2 = Cesium.Cartographic.fromCartesian(pos);
|
|
238
|
+
const h1 = c1.height || 0;
|
|
239
|
+
const h2 = c2.height || 0;
|
|
240
|
+
const low = h1 <= h2 ? this.positions[0] : pos;
|
|
241
|
+
const high = h1 > h2 ? this.positions[0] : pos;
|
|
242
|
+
const cl = Cesium.Cartographic.fromCartesian(low);
|
|
243
|
+
const maxH = Math.max(h1, h2);
|
|
244
|
+
const third = Cesium.Cartesian3.fromDegrees(
|
|
245
|
+
this.Cesium.Math.toDegrees(cl.longitude),
|
|
246
|
+
this.Cesium.Math.toDegrees(cl.latitude),
|
|
247
|
+
maxH,
|
|
248
|
+
);
|
|
249
|
+
this.previewLow = low;
|
|
250
|
+
this.previewHigh = high;
|
|
251
|
+
this.previewThird = third;
|
|
252
|
+
const solidColor = options.lineColor || options.color || Cesium.Color.YELLOW;
|
|
253
|
+
const dashColor = (options.dashLineColor || options.lineColor || options.color || Cesium.Color.RED).withAlpha?.(0.9) || Cesium.Color.RED;
|
|
254
|
+
if (!this.previewPointEntity) {
|
|
255
|
+
this.previewPointEntity = viewer.entities.add({
|
|
256
|
+
position: pos,
|
|
257
|
+
point: {
|
|
258
|
+
pixelSize: 8,
|
|
259
|
+
color: options.pointColor || options.color || Cesium.Color.YELLOW,
|
|
260
|
+
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
|
261
|
+
},
|
|
262
|
+
});
|
|
263
|
+
} else {
|
|
264
|
+
this.previewPointEntity.position = pos;
|
|
265
|
+
}
|
|
266
|
+
if (!this.previewSegmentEntities.length) {
|
|
267
|
+
const pv = viewer.entities.add({
|
|
268
|
+
polyline: {
|
|
269
|
+
positions: new Cesium.CallbackProperty(() => {
|
|
270
|
+
if (!this.previewLow || !this.previewThird) return [];
|
|
271
|
+
return [this.previewLow, this.previewThird];
|
|
272
|
+
}, false),
|
|
273
|
+
width: options.width || 3,
|
|
274
|
+
material: solidColor,
|
|
275
|
+
depthFailMaterial: new Cesium.PolylineDashMaterialProperty({ color: dashColor, dashLength: 12, dashPattern: 255 }),
|
|
276
|
+
},
|
|
277
|
+
});
|
|
278
|
+
const ph = viewer.entities.add({
|
|
279
|
+
polyline: {
|
|
280
|
+
positions: new Cesium.CallbackProperty(() => {
|
|
281
|
+
if (!this.previewThird || !this.previewHigh) return [];
|
|
282
|
+
return [this.previewThird, this.previewHigh];
|
|
283
|
+
}, false),
|
|
284
|
+
width: options.width || 3,
|
|
285
|
+
material: solidColor,
|
|
286
|
+
depthFailMaterial: new Cesium.PolylineDashMaterialProperty({ color: dashColor, dashLength: 12, dashPattern: 255 }),
|
|
287
|
+
},
|
|
288
|
+
});
|
|
289
|
+
const phyp = viewer.entities.add({
|
|
290
|
+
polyline: {
|
|
291
|
+
positions: new Cesium.CallbackProperty(() => {
|
|
292
|
+
if (!this.previewLow || !this.previewHigh) return [];
|
|
293
|
+
return [this.previewLow, this.previewHigh];
|
|
294
|
+
}, false),
|
|
295
|
+
width: options.width || 3,
|
|
296
|
+
material: solidColor,
|
|
297
|
+
depthFailMaterial: new Cesium.PolylineDashMaterialProperty({ color: dashColor, dashLength: 12, dashPattern: 255 }),
|
|
298
|
+
},
|
|
299
|
+
});
|
|
300
|
+
this.previewSegmentEntities.push(pv, ph, phyp);
|
|
301
|
+
}
|
|
302
|
+
const lenV = Cesium.Cartesian3.distance(low, third);
|
|
303
|
+
const lenH = Cesium.Cartesian3.distance(third, high);
|
|
304
|
+
const lenHyp = Cesium.Cartesian3.distance(low, high);
|
|
305
|
+
const vLowToHigh = Cesium.Cartesian3.subtract(high, low, new Cesium.Cartesian3());
|
|
306
|
+
const vLowToThird = Cesium.Cartesian3.subtract(third, low, new Cesium.Cartesian3());
|
|
307
|
+
const vHighToThird = Cesium.Cartesian3.subtract(third, high, new Cesium.Cartesian3());
|
|
308
|
+
const vHighToLow = Cesium.Cartesian3.subtract(low, high, new Cesium.Cartesian3());
|
|
309
|
+
const dotA = Cesium.Cartesian3.dot(vLowToHigh, vLowToThird);
|
|
310
|
+
const magA = Math.sqrt(Cesium.Cartesian3.dot(vLowToHigh, vLowToHigh)) * Math.sqrt(Cesium.Cartesian3.dot(vLowToThird, vLowToThird));
|
|
311
|
+
const dotB = Cesium.Cartesian3.dot(vHighToThird, vHighToLow);
|
|
312
|
+
const magB = Math.sqrt(Cesium.Cartesian3.dot(vHighToThird, vHighToThird)) * Math.sqrt(Cesium.Cartesian3.dot(vHighToLow, vHighToLow));
|
|
313
|
+
const angleA = Math.acos(Math.min(Math.max((dotA / (magA || 1)), -1), 1));
|
|
314
|
+
const angleB = Math.acos(Math.min(Math.max((dotB / (magB || 1)), -1), 1));
|
|
315
|
+
const midV = new Cesium.Cartesian3((low.x + third.x) / 2, (low.y + third.y) / 2, (low.z + third.z) / 2);
|
|
316
|
+
const midH = new Cesium.Cartesian3((third.x + high.x) / 2, (third.y + high.y) / 2, (third.z + high.z) / 2);
|
|
317
|
+
const midHyp = new Cesium.Cartesian3((low.x + high.x) / 2, (low.y + high.y) / 2, (low.z + high.z) / 2);
|
|
318
|
+
const mV = Cesium.Cartographic.fromCartesian(midV);
|
|
319
|
+
const mH = Cesium.Cartographic.fromCartesian(midH);
|
|
320
|
+
const mHyp = Cesium.Cartographic.fromCartesian(midHyp);
|
|
321
|
+
const cLow = Cesium.Cartographic.fromCartesian(low);
|
|
322
|
+
const cHigh = Cesium.Cartographic.fromCartesian(high);
|
|
323
|
+
const idV = 'measure_triangle_seg_v';
|
|
324
|
+
const idH = 'measure_triangle_seg_h';
|
|
325
|
+
const idHyp = 'measure_triangle_seg_hyp';
|
|
326
|
+
const idAngA = 'measure_triangle_angle_a';
|
|
327
|
+
const idAngB = 'measure_triangle_angle_b';
|
|
328
|
+
if (this.segmentLabelIds.length === 0) {
|
|
329
|
+
this.segmentLabelIds = [idV, idH, idHyp];
|
|
330
|
+
}
|
|
331
|
+
if (this.angleLabelIds.length === 0) {
|
|
332
|
+
this.angleLabelIds = [idAngA, idAngB];
|
|
333
|
+
}
|
|
334
|
+
this.htmlLabelPool.add({ text: `${lenV.toFixed(2)} m` }, { id: idV, lon: Cesium.Math.toDegrees(mV.longitude), lat: Cesium.Math.toDegrees(mV.latitude), height: mV.height || 0, theme: 'measure-triangle-seg', show: true, style: { pointerEvents: 'none', userSelect: 'none', cursor: 'default' } });
|
|
335
|
+
this.htmlLabelPool.add({ text: `${lenH.toFixed(2)} m` }, { id: idH, lon: Cesium.Math.toDegrees(mH.longitude), lat: Cesium.Math.toDegrees(mH.latitude), height: mH.height || 0, theme: 'measure-triangle-seg', show: true, style: { pointerEvents: 'none', userSelect: 'none', cursor: 'default' } });
|
|
336
|
+
this.htmlLabelPool.add({ text: `${lenHyp.toFixed(2)} m` }, { id: idHyp, lon: Cesium.Math.toDegrees(mHyp.longitude), lat: Cesium.Math.toDegrees(mHyp.latitude), height: mHyp.height || 0, theme: 'measure-triangle-seg', show: true, style: { pointerEvents: 'none', userSelect: 'none', cursor: 'default' } });
|
|
337
|
+
this.htmlLabelPool.add({ text: `${(angleA * 180 / Math.PI).toFixed(2)}°` }, { id: idAngA, lon: Cesium.Math.toDegrees(cLow.longitude), lat: Cesium.Math.toDegrees(cLow.latitude), height: cLow.height || 0, theme: 'measure-triangle-angle', show: true, style: { pointerEvents: 'none', userSelect: 'none', cursor: 'default' } });
|
|
338
|
+
this.htmlLabelPool.add({ text: `${(angleB * 180 / Math.PI).toFixed(2)}°` }, { id: idAngB, lon: Cesium.Math.toDegrees(cHigh.longitude), lat: Cesium.Math.toDegrees(cHigh.latitude), height: cHigh.height || 0, theme: 'measure-triangle-angle', show: true, style: { pointerEvents: 'none', userSelect: 'none', cursor: 'default' } });
|
|
339
|
+
const ratio = Math.max(0.01, Math.min(0.5, options.angleMarkerRatio ?? 0.2));
|
|
340
|
+
const markerLen = Math.min(lenV, lenH) * ratio;
|
|
341
|
+
if (lenV > 0.001 && lenH > 0.001) {
|
|
342
|
+
const dirV = Cesium.Cartesian3.normalize(
|
|
343
|
+
Cesium.Cartesian3.subtract(low, third, new Cesium.Cartesian3()),
|
|
344
|
+
new Cesium.Cartesian3(),
|
|
345
|
+
);
|
|
346
|
+
const dirH = Cesium.Cartesian3.normalize(
|
|
347
|
+
Cesium.Cartesian3.subtract(high, third, new Cesium.Cartesian3()),
|
|
348
|
+
new Cesium.Cartesian3(),
|
|
349
|
+
);
|
|
350
|
+
const pOffV = new Cesium.Cartesian3(
|
|
351
|
+
third.x + dirV.x * markerLen,
|
|
352
|
+
third.y + dirV.y * markerLen,
|
|
353
|
+
third.z + dirV.z * markerLen,
|
|
354
|
+
);
|
|
355
|
+
const pOffH = new Cesium.Cartesian3(
|
|
356
|
+
third.x + dirH.x * markerLen,
|
|
357
|
+
third.y + dirH.y * markerLen,
|
|
358
|
+
third.z + dirH.z * markerLen,
|
|
359
|
+
);
|
|
360
|
+
const pCorner = new Cesium.Cartesian3(
|
|
361
|
+
third.x + dirV.x * markerLen + dirH.x * markerLen,
|
|
362
|
+
third.y + dirV.y * markerLen + dirH.y * markerLen,
|
|
363
|
+
third.z + dirV.z * markerLen + dirH.z * markerLen,
|
|
364
|
+
);
|
|
365
|
+
this.previewMarkerP1 = pOffV;
|
|
366
|
+
this.previewMarkerP2 = pOffH;
|
|
367
|
+
this.previewMarkerCorner = pCorner;
|
|
368
|
+
if (!this.previewAngleMarkerEntities.length) {
|
|
369
|
+
const rightMarkerSeg1 = viewer.entities.add({
|
|
370
|
+
polyline: {
|
|
371
|
+
positions: new Cesium.CallbackProperty(() => {
|
|
372
|
+
if (!this.previewMarkerP1 || !this.previewMarkerCorner) return [];
|
|
373
|
+
return [this.previewMarkerP1, this.previewMarkerCorner];
|
|
374
|
+
}, false),
|
|
375
|
+
width: options.width || 3,
|
|
376
|
+
material: solidColor,
|
|
377
|
+
depthFailMaterial: new Cesium.PolylineDashMaterialProperty({ color: dashColor, dashLength: 12, dashPattern: 255 }),
|
|
378
|
+
},
|
|
379
|
+
});
|
|
380
|
+
const rightMarkerSeg2 = viewer.entities.add({
|
|
381
|
+
polyline: {
|
|
382
|
+
positions: new Cesium.CallbackProperty(() => {
|
|
383
|
+
if (!this.previewMarkerP2 || !this.previewMarkerCorner) return [];
|
|
384
|
+
return [this.previewMarkerP2, this.previewMarkerCorner];
|
|
385
|
+
}, false),
|
|
386
|
+
width: options.width || 3,
|
|
387
|
+
material: solidColor,
|
|
388
|
+
depthFailMaterial: new Cesium.PolylineDashMaterialProperty({ color: dashColor, dashLength: 12, dashPattern: 255 }),
|
|
389
|
+
},
|
|
390
|
+
});
|
|
391
|
+
this.previewAngleMarkerEntities.push(rightMarkerSeg1, rightMarkerSeg2);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
stop() {
|
|
398
|
+
if (this.handler) {
|
|
399
|
+
this.handler.destroy();
|
|
400
|
+
this.handler = null;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
clear() {
|
|
405
|
+
this.stop();
|
|
406
|
+
this.segmentEntities.forEach((e) => this.viewer.entities.remove(e));
|
|
407
|
+
this.segmentEntities = [];
|
|
408
|
+
this.angleMarkerEntities.forEach((e) => this.viewer.entities.remove(e));
|
|
409
|
+
this.angleMarkerEntities = [];
|
|
410
|
+
this.pointEntities.forEach((e) => this.viewer.entities.remove(e));
|
|
411
|
+
this.pointEntities = [];
|
|
412
|
+
this.previewSegmentEntities.forEach((e) => this.viewer.entities.remove(e));
|
|
413
|
+
this.previewSegmentEntities = [];
|
|
414
|
+
this.previewAngleMarkerEntities.forEach((e) => this.viewer.entities.remove(e));
|
|
415
|
+
this.previewAngleMarkerEntities = [];
|
|
416
|
+
if (this.previewPointEntity) {
|
|
417
|
+
this.viewer.entities.remove(this.previewPointEntity);
|
|
418
|
+
this.previewPointEntity = null;
|
|
419
|
+
}
|
|
420
|
+
if (this.htmlLabelPool && this.htmlLabelId) {
|
|
421
|
+
this.htmlLabelPool.removeByIds([this.htmlLabelId]);
|
|
422
|
+
this.htmlLabelId = null;
|
|
423
|
+
}
|
|
424
|
+
if (this.previewLabelId && this.htmlLabelPool) {
|
|
425
|
+
this.htmlLabelPool.removeByIds([this.previewLabelId]);
|
|
426
|
+
this.previewLabelId = null;
|
|
427
|
+
}
|
|
428
|
+
if (this.segmentLabelIds.length && this.htmlLabelPool) {
|
|
429
|
+
this.htmlLabelPool.removeByIds(this.segmentLabelIds.slice());
|
|
430
|
+
}
|
|
431
|
+
if (this.angleLabelIds.length && this.htmlLabelPool) {
|
|
432
|
+
this.htmlLabelPool.removeByIds(this.angleLabelIds.slice());
|
|
433
|
+
}
|
|
434
|
+
this.segmentLabelIds = [];
|
|
435
|
+
this.angleLabelIds = [];
|
|
436
|
+
this.positions = [];
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
rehydrate(record: MeasurementRecord, htmlLabelPool?: HtmlOverlayLabelPool) {
|
|
440
|
+
const Cesium = this.Cesium;
|
|
441
|
+
const viewer = this.viewer;
|
|
442
|
+
const opts = (record.options || {}) as MeasurementOptions;
|
|
443
|
+
const lineColor = opts.lineColor || opts.color || Cesium.Color.YELLOW;
|
|
444
|
+
const dashColor = (opts.dashLineColor || opts.lineColor || opts.color || Cesium.Color.RED).withAlpha?.(0.9) || Cesium.Color.RED;
|
|
445
|
+
const width = opts.width || 3;
|
|
446
|
+
const posList = (record.positions || []).map((p) => new Cesium.Cartesian3(p[0], p[1], p[2]));
|
|
447
|
+
if (posList.length < 2) return;
|
|
448
|
+
if (!this.htmlLabelPool) {
|
|
449
|
+
const containerId = opts.overlayContainerId || 'html-label-container';
|
|
450
|
+
this.htmlLabelPool = htmlLabelPool || new HtmlOverlayLabelPool(Cesium, viewer, containerId);
|
|
451
|
+
this.htmlLabelPool.registerTheme('measure-triangle', {
|
|
452
|
+
createElement: (el: HTMLDivElement, ctx: any) => {
|
|
453
|
+
el.innerHTML = String(ctx?.data?.text || '');
|
|
454
|
+
el.style.background = 'rgba(0,0,0,0.6)';
|
|
455
|
+
el.style.color = '#fff';
|
|
456
|
+
el.style.font = '14px sans-serif';
|
|
457
|
+
el.style.padding = '4px 6px';
|
|
458
|
+
el.style.borderRadius = '4px';
|
|
459
|
+
el.style.whiteSpace = 'pre';
|
|
460
|
+
},
|
|
461
|
+
options: { offset: { x: 0, y: -10 } },
|
|
462
|
+
});
|
|
463
|
+
this.htmlLabelPool.registerTheme('measure-triangle-seg', {
|
|
464
|
+
createElement: (el: HTMLDivElement, ctx: any) => {
|
|
465
|
+
el.innerHTML = String(ctx?.data?.text || '');
|
|
466
|
+
el.style.background = 'rgba(0,0,0,0.6)';
|
|
467
|
+
el.style.color = '#fff';
|
|
468
|
+
el.style.font = '14px sans-serif';
|
|
469
|
+
el.style.padding = '4px 6px';
|
|
470
|
+
el.style.borderRadius = '4px';
|
|
471
|
+
el.style.whiteSpace = 'pre';
|
|
472
|
+
},
|
|
473
|
+
options: { offset: { x: 0, y: -10 } },
|
|
474
|
+
});
|
|
475
|
+
this.htmlLabelPool.registerTheme('measure-triangle-angle', {
|
|
476
|
+
createElement: (el: HTMLDivElement, ctx: any) => {
|
|
477
|
+
el.innerHTML = String(ctx?.data?.text || '');
|
|
478
|
+
el.style.background = 'rgba(0,0,0,0.6)';
|
|
479
|
+
el.style.color = '#fff';
|
|
480
|
+
el.style.font = '14px sans-serif';
|
|
481
|
+
el.style.padding = '4px 6px';
|
|
482
|
+
el.style.borderRadius = '4px';
|
|
483
|
+
el.style.whiteSpace = 'pre';
|
|
484
|
+
},
|
|
485
|
+
options: { offset: { x: 0, y: -10 } },
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
const c1 = Cesium.Cartographic.fromCartesian(posList[0]);
|
|
489
|
+
const c2 = Cesium.Cartographic.fromCartesian(posList[1]);
|
|
490
|
+
const h1 = c1.height || 0;
|
|
491
|
+
const h2 = c2.height || 0;
|
|
492
|
+
const low = h1 <= h2 ? posList[0] : posList[1];
|
|
493
|
+
const high = h1 > h2 ? posList[0] : posList[1];
|
|
494
|
+
const pLow = viewer.entities.add({ position: low, point: { pixelSize: 8, color: opts.pointColor || opts.color || Cesium.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } });
|
|
495
|
+
const pHigh = viewer.entities.add({ position: high, point: { pixelSize: 8, color: opts.pointColor || opts.color || Cesium.Color.YELLOW, disableDepthTestDistance: Number.POSITIVE_INFINITY } });
|
|
496
|
+
this.pointEntities.push(pLow, pHigh);
|
|
497
|
+
const cl = Cesium.Cartographic.fromCartesian(low);
|
|
498
|
+
const maxH = Math.max(h1, h2);
|
|
499
|
+
const third = Cesium.Cartesian3.fromDegrees(
|
|
500
|
+
Cesium.Math.toDegrees(cl.longitude),
|
|
501
|
+
Cesium.Math.toDegrees(cl.latitude),
|
|
502
|
+
maxH,
|
|
503
|
+
);
|
|
504
|
+
const vertical = viewer.entities.add({
|
|
505
|
+
polyline: { positions: [low, third], width, material: lineColor, depthFailMaterial: new Cesium.PolylineDashMaterialProperty({ color: dashColor, dashLength: 12, dashPattern: 255 }) },
|
|
506
|
+
});
|
|
507
|
+
const horizontal = viewer.entities.add({
|
|
508
|
+
polyline: { positions: [third, high], width, material: lineColor, depthFailMaterial: new Cesium.PolylineDashMaterialProperty({ color: dashColor, dashLength: 12, dashPattern: 255 }) },
|
|
509
|
+
});
|
|
510
|
+
const hypotenuse = viewer.entities.add({
|
|
511
|
+
polyline: { positions: [low, high], width, material: lineColor, depthFailMaterial: new Cesium.PolylineDashMaterialProperty({ color: dashColor, dashLength: 12, dashPattern: 255 }) },
|
|
512
|
+
});
|
|
513
|
+
this.segmentEntities.push(vertical, horizontal, hypotenuse);
|
|
514
|
+
const lenV = Cesium.Cartesian3.distance(low, third);
|
|
515
|
+
const lenH = Cesium.Cartesian3.distance(third, high);
|
|
516
|
+
const lenHyp = Cesium.Cartesian3.distance(low, high);
|
|
517
|
+
const midV = new Cesium.Cartesian3((low.x + third.x) / 2, (low.y + third.y) / 2, (low.z + third.z) / 2);
|
|
518
|
+
const midH = new Cesium.Cartesian3((third.x + high.x) / 2, (third.y + high.y) / 2, (third.z + high.z) / 2);
|
|
519
|
+
const midHyp = new Cesium.Cartesian3((low.x + high.x) / 2, (low.y + high.y) / 2, (low.z + high.z) / 2);
|
|
520
|
+
const mV = Cesium.Cartographic.fromCartesian(midV);
|
|
521
|
+
const mH = Cesium.Cartographic.fromCartesian(midH);
|
|
522
|
+
const mHyp = Cesium.Cartographic.fromCartesian(midHyp);
|
|
523
|
+
const idV = record.id + '_tri_v';
|
|
524
|
+
const idH = record.id + '_tri_h';
|
|
525
|
+
const idHyp = record.id + '_tri_hyp';
|
|
526
|
+
this.segmentLabelIds = [idV, idH, idHyp];
|
|
527
|
+
this.htmlLabelPool.add({ text: `${lenV.toFixed(2)} m` }, { id: idV, lon: Cesium.Math.toDegrees(mV.longitude), lat: Cesium.Math.toDegrees(mV.latitude), height: mV.height || 0, theme: 'measure-triangle-seg', show: true, style: { pointerEvents: 'none', userSelect: 'none', cursor: 'default' } });
|
|
528
|
+
this.htmlLabelPool.add({ text: `${lenH.toFixed(2)} m` }, { id: idH, lon: Cesium.Math.toDegrees(mH.longitude), lat: Cesium.Math.toDegrees(mH.latitude), height: mH.height || 0, theme: 'measure-triangle-seg', show: true, style: { pointerEvents: 'none', userSelect: 'none', cursor: 'default' } });
|
|
529
|
+
this.htmlLabelPool.add({ text: `${lenHyp.toFixed(2)} m` }, { id: idHyp, lon: Cesium.Math.toDegrees(mHyp.longitude), lat: Cesium.Math.toDegrees(mHyp.latitude), height: mHyp.height || 0, theme: 'measure-triangle-seg', show: true, style: { pointerEvents: 'none', userSelect: 'none', cursor: 'default' } });
|
|
530
|
+
const vLowToHigh = Cesium.Cartesian3.subtract(high, low, new Cesium.Cartesian3());
|
|
531
|
+
const vLowToThird = Cesium.Cartesian3.subtract(third, low, new Cesium.Cartesian3());
|
|
532
|
+
const vHighToThird = Cesium.Cartesian3.subtract(third, high, new Cesium.Cartesian3());
|
|
533
|
+
const vHighToLow = Cesium.Cartesian3.subtract(low, high, new Cesium.Cartesian3());
|
|
534
|
+
const dotA = Cesium.Cartesian3.dot(vLowToHigh, vLowToThird);
|
|
535
|
+
const magA = Math.sqrt(Cesium.Cartesian3.dot(vLowToHigh, vLowToHigh)) * Math.sqrt(Cesium.Cartesian3.dot(vLowToThird, vLowToThird));
|
|
536
|
+
const dotB = Cesium.Cartesian3.dot(vHighToThird, vHighToLow);
|
|
537
|
+
const magB = Math.sqrt(Cesium.Cartesian3.dot(vHighToThird, vHighToThird)) * Math.sqrt(Cesium.Cartesian3.dot(vHighToLow, vHighToLow));
|
|
538
|
+
const angleA = Math.acos(Math.min(Math.max(dotA / (magA || 1), -1), 1));
|
|
539
|
+
const angleB = Math.acos(Math.min(Math.max(dotB / (magB || 1), -1), 1));
|
|
540
|
+
const cLow = Cesium.Cartographic.fromCartesian(low);
|
|
541
|
+
const cHigh = Cesium.Cartographic.fromCartesian(high);
|
|
542
|
+
const t = opts.labelText || { angle: '角度' };
|
|
543
|
+
const idAngA = record.id + '_tri_angA';
|
|
544
|
+
const idAngB = record.id + '_tri_angB';
|
|
545
|
+
this.angleLabelIds = [idAngA, idAngB];
|
|
546
|
+
this.htmlLabelPool.add({ text: `${t.angle}:${(angleA * 180 / Math.PI).toFixed(2)}°` }, { id: idAngA, lon: Cesium.Math.toDegrees(cLow.longitude), lat: Cesium.Math.toDegrees(cLow.latitude), height: cLow.height || 0, theme: 'measure-triangle-angle', show: true, style: { pointerEvents: 'none', userSelect: 'none', cursor: 'default' } });
|
|
547
|
+
this.htmlLabelPool.add({ text: `${t.angle}:${(angleB * 180 / Math.PI).toFixed(2)}°` }, { id: idAngB, lon: Cesium.Math.toDegrees(cHigh.longitude), lat: Cesium.Math.toDegrees(cHigh.latitude), height: cHigh.height || 0, theme: 'measure-triangle-angle', show: true, style: { pointerEvents: 'none', userSelect: 'none', cursor: 'default' } });
|
|
548
|
+
const ratio = Math.max(0.01, Math.min(0.5, opts.angleMarkerRatio ?? 0.2));
|
|
549
|
+
const markerLen = Math.min(lenV, lenH) * ratio;
|
|
550
|
+
if (lenV > 0.001 && lenH > 0.001) {
|
|
551
|
+
const dirV = Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(low, third, new Cesium.Cartesian3()), new Cesium.Cartesian3());
|
|
552
|
+
const dirH = Cesium.Cartesian3.normalize(Cesium.Cartesian3.subtract(high, third, new Cesium.Cartesian3()), new Cesium.Cartesian3());
|
|
553
|
+
const pOffV = new Cesium.Cartesian3(third.x + dirV.x * markerLen, third.y + dirV.y * markerLen, third.z + dirV.z * markerLen);
|
|
554
|
+
const pOffH = new Cesium.Cartesian3(third.x + dirH.x * markerLen, third.y + dirH.y * markerLen, third.z + dirH.z * markerLen);
|
|
555
|
+
const pCorner = new Cesium.Cartesian3(third.x + dirV.x * markerLen + dirH.x * markerLen, third.y + dirV.y * markerLen + dirH.y * markerLen, third.z + dirV.z * markerLen + dirH.z * markerLen);
|
|
556
|
+
const rightMarkerSeg1 = viewer.entities.add({ polyline: { positions: [pOffV, pCorner], width, material: lineColor, depthFailMaterial: new Cesium.PolylineDashMaterialProperty({ color: dashColor, dashLength: 12, dashPattern: 255 }) } });
|
|
557
|
+
const rightMarkerSeg2 = viewer.entities.add({ polyline: { positions: [pOffH, pCorner], width, material: lineColor, depthFailMaterial: new Cesium.PolylineDashMaterialProperty({ color: dashColor, dashLength: 12, dashPattern: 255 }) } });
|
|
558
|
+
this.angleMarkerEntities.push(rightMarkerSeg1, rightMarkerSeg2);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
}
|