leiting-bim 2.1.35 → 2.1.37
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 +2818 -2687
- package/leiting-bim.umd.js +9 -9
- 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,556 @@
|
|
|
1
|
+
import { EntityLayerManager } from '../entity/EntityLayer';
|
|
2
|
+
import { MaterialManager } from '../Material/MaterialManager';
|
|
3
|
+
import { cloneDeep } from 'lodash-es';
|
|
4
|
+
export class PrimitiveManager {
|
|
5
|
+
private Cesium: any;
|
|
6
|
+
private viewer: any; // Cesium.Viewer
|
|
7
|
+
private layerMap: Map<string, Map<string, any>>;
|
|
8
|
+
private hideLayerMap: Map<string, Set<string>>;
|
|
9
|
+
entityLayerManager: EntityLayerManager;
|
|
10
|
+
private PrimitiveThemeMap: Map<
|
|
11
|
+
string,
|
|
12
|
+
{
|
|
13
|
+
Primitive: any;
|
|
14
|
+
ids: Map<string, any>;
|
|
15
|
+
geometryInstances: Map<string, any>;
|
|
16
|
+
appearance: any;
|
|
17
|
+
}
|
|
18
|
+
>; // theme -> 合并后的 Primitive 和图元 ID 的映射
|
|
19
|
+
materialManager: MaterialManager;
|
|
20
|
+
|
|
21
|
+
constructor(options: {
|
|
22
|
+
Cesium: any;
|
|
23
|
+
viewer: any;
|
|
24
|
+
materialManager: MaterialManager;
|
|
25
|
+
entityLayerManager: EntityLayerManager;
|
|
26
|
+
}) {
|
|
27
|
+
let { Cesium, viewer, materialManager, entityLayerManager } = options;
|
|
28
|
+
this.Cesium = Cesium;
|
|
29
|
+
this.viewer = viewer;
|
|
30
|
+
this.layerMap = new Map();
|
|
31
|
+
this.PrimitiveThemeMap = new Map(); // 存储 theme -> { Primitive, ids, geometryInstances }
|
|
32
|
+
this.hideLayerMap = new Map();
|
|
33
|
+
this.materialManager = materialManager;
|
|
34
|
+
this.entityLayerManager = entityLayerManager;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
//创建图元
|
|
38
|
+
private createGeometryInstance(item: any): any {
|
|
39
|
+
let geometryInstance: any;
|
|
40
|
+
if (item.category === 'polyline' && item.positions) {
|
|
41
|
+
geometryInstance = this.createPolyline(item);
|
|
42
|
+
} else if (item.category === 'polygon' && item.hierarchy) {
|
|
43
|
+
geometryInstance = this.createPolygon(item);
|
|
44
|
+
}
|
|
45
|
+
return geometryInstance;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// 创建或获取 材质图元组
|
|
49
|
+
private carateThemePrimitive(_item: any) {
|
|
50
|
+
let item = cloneDeep(_item);
|
|
51
|
+
let themePrimitive = this.PrimitiveThemeMap.get(item.theme);
|
|
52
|
+
if (!themePrimitive) {
|
|
53
|
+
this.initTheme(item);
|
|
54
|
+
// 如果没有,则初始化一个新的 entry
|
|
55
|
+
let appearance = this.createAppearance(item);
|
|
56
|
+
themePrimitive = {
|
|
57
|
+
Primitive: null,
|
|
58
|
+
ids: new Map(),
|
|
59
|
+
appearance: appearance,
|
|
60
|
+
geometryInstances: new Map(),
|
|
61
|
+
};
|
|
62
|
+
this.PrimitiveThemeMap.set(item.theme, themePrimitive);
|
|
63
|
+
}
|
|
64
|
+
return themePrimitive;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
//注册主题
|
|
68
|
+
initTheme(item: any) {
|
|
69
|
+
let materialManager = this.materialManager;
|
|
70
|
+
let Cesium = this.Cesium;
|
|
71
|
+
if (item.category == 'polyline') {
|
|
72
|
+
const isDashed =
|
|
73
|
+
item.properties?.lineType?.pattern && item.properties?.lineType?.patternLength;
|
|
74
|
+
let lineMaterialKey = '';
|
|
75
|
+
if (isDashed) {
|
|
76
|
+
const dashPattern = item.properties?.lineType?.pattern || [0.25, -0.125];
|
|
77
|
+
const dashLength = item.properties?.lineType?.patternLength || 0.375;
|
|
78
|
+
let cesiumDash = this.convertCadPatternToCesiumDash(dashPattern, dashLength);
|
|
79
|
+
lineMaterialKey = `DashedLineMaterial_pattern_${cesiumDash.dashPattern}_dashLength_${cesiumDash.dashLength}_color_${item.properties?.color}`;
|
|
80
|
+
if (!materialManager.has(lineMaterialKey)) {
|
|
81
|
+
materialManager.register({
|
|
82
|
+
themeKey: lineMaterialKey,
|
|
83
|
+
material: Cesium.Material.fromType('PolylineDash', {
|
|
84
|
+
color: Cesium.Color.fromCssColorString(item.properties.color || '#FFFFFF').withAlpha(
|
|
85
|
+
0.8,
|
|
86
|
+
),
|
|
87
|
+
dashLength: cesiumDash.dashLength, // ← 注意,这里填总长度
|
|
88
|
+
dashPattern: cesiumDash.dashPattern, // ← 这里才是 16-bit 掩码
|
|
89
|
+
}),
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
} else {
|
|
93
|
+
lineMaterialKey = `LineMaterial_color_${item.properties?.color}`;
|
|
94
|
+
if (!materialManager.has(lineMaterialKey)) {
|
|
95
|
+
materialManager.register({
|
|
96
|
+
themeKey: lineMaterialKey,
|
|
97
|
+
material: Cesium.Material.fromType('Color', {
|
|
98
|
+
color: Cesium.Color.fromCssColorString(item.properties.color || '#FFFFFF').withAlpha(
|
|
99
|
+
0.8,
|
|
100
|
+
),
|
|
101
|
+
}),
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
} else if (item.category == 'polygon') {
|
|
106
|
+
let polygonMaterialKey = `polygonMaterial_color_${item.properties?.color}`;
|
|
107
|
+
if (!materialManager.has(polygonMaterialKey)) {
|
|
108
|
+
materialManager.register({
|
|
109
|
+
themeKey: polygonMaterialKey,
|
|
110
|
+
material: Cesium.Material.fromType('Color', {
|
|
111
|
+
color: Cesium.Color.fromCssColorString(item.properties?.color || '#FFFFFF').withAlpha(
|
|
112
|
+
0.8,
|
|
113
|
+
),
|
|
114
|
+
}),
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
convertCadPatternToCesiumDash(pattern: Array<number>, patternLength: number) {
|
|
121
|
+
const segmentCount = 16;
|
|
122
|
+
const unitLength = patternLength / segmentCount;
|
|
123
|
+
|
|
124
|
+
// 第一步:先用 floor 分配位数,统计已经分配的位数
|
|
125
|
+
let dashBits = [] as Array<number>;
|
|
126
|
+
let assigned = 0;
|
|
127
|
+
for (let len of pattern) {
|
|
128
|
+
const count = Math.floor(Math.abs(len) / unitLength);
|
|
129
|
+
const bit = len >= 0 ? 1 : 0;
|
|
130
|
+
for (let i = 0; i < count; i++) {
|
|
131
|
+
dashBits.push(bit);
|
|
132
|
+
assigned++;
|
|
133
|
+
if (assigned >= segmentCount) break;
|
|
134
|
+
}
|
|
135
|
+
if (assigned >= segmentCount) break;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// 如果分配不到 16 位,用 “空” 填满;如果多了,则截断
|
|
139
|
+
while (dashBits.length < segmentCount) {
|
|
140
|
+
dashBits.push(0);
|
|
141
|
+
}
|
|
142
|
+
if (dashBits.length > segmentCount) {
|
|
143
|
+
dashBits.length = segmentCount;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// 第二步:把 16 位数组变成一个整数
|
|
147
|
+
let dashPattern = 0;
|
|
148
|
+
for (let i = 0; i < segmentCount; i++) {
|
|
149
|
+
dashPattern = (dashPattern << 1) | dashBits[i];
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return {
|
|
153
|
+
dashPattern: dashPattern,
|
|
154
|
+
dashLength: patternLength,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// 创建或更新图层并添加几何体
|
|
159
|
+
public async processBatch(data: Array<{ layerId: string; dataList: any[] }>): Promise<void> {
|
|
160
|
+
const materialThemes = new Map(); // 用于记录所有出现的材质 theme
|
|
161
|
+
data.forEach((item) => {
|
|
162
|
+
let { layerId, dataList } = item;
|
|
163
|
+
let batch = cloneDeep(dataList);
|
|
164
|
+
batch.forEach((item) => {
|
|
165
|
+
let geometryInstance = this.createGeometryInstance(item);
|
|
166
|
+
|
|
167
|
+
if (geometryInstance) {
|
|
168
|
+
// 检查是否已有相同 theme 的 Primitive
|
|
169
|
+
let themePrimitive = this.carateThemePrimitive(item);
|
|
170
|
+
|
|
171
|
+
// 将当前 item 的 id 添加到 themePrimitive.ids 中
|
|
172
|
+
themePrimitive.ids.set(item.id, item);
|
|
173
|
+
themePrimitive.geometryInstances.set(item.id, geometryInstance); // 添加到几何实例集合中
|
|
174
|
+
|
|
175
|
+
const layer = this.layerMap.get(layerId);
|
|
176
|
+
if (layer) {
|
|
177
|
+
layer.set(item.id, item);
|
|
178
|
+
} else {
|
|
179
|
+
let map = new Map();
|
|
180
|
+
this.layerMap.set(layerId, map);
|
|
181
|
+
map.set(item.id, item);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// 记录 materialTheme
|
|
185
|
+
materialThemes.set(item.theme, item);
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
// 循环结束后,统一调用 updatePrimitive
|
|
190
|
+
materialThemes.forEach((item) => {
|
|
191
|
+
this.updatePrimitive(item);
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// 创建折线几何体(不再获取材质)
|
|
196
|
+
private createPolyline(item: any): any {
|
|
197
|
+
const positions = Array.isArray(item.positions[0]) ? item.positions.flat() : item.positions;
|
|
198
|
+
return new this.Cesium.GeometryInstance({
|
|
199
|
+
id: item.id,
|
|
200
|
+
geometry: new this.Cesium.GroundPolylineGeometry({
|
|
201
|
+
positions: this.Cesium.Cartesian3.fromDegreesArrayHeights(positions),
|
|
202
|
+
// width: 10,
|
|
203
|
+
width: Math.max(item.width || 2, 2),
|
|
204
|
+
}),
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// 创建多边形几何体(不再获取材质)
|
|
209
|
+
private createPolygon(item: any): any {
|
|
210
|
+
const outerRing = Array.isArray(item.hierarchy[0]) ? item.hierarchy.flat() : item.hierarchy;
|
|
211
|
+
const outerCartesian = this.Cesium.Cartesian3.fromDegreesArrayHeights(outerRing);
|
|
212
|
+
const holes =
|
|
213
|
+
item.holes?.map((hole: any) => {
|
|
214
|
+
let _hole = Array.isArray(hole[0]) ? hole.flat() : hole;
|
|
215
|
+
let _holeDegrees = this.Cesium.Cartesian3.fromDegreesArrayHeights(_hole.flat());
|
|
216
|
+
return new this.Cesium.PolygonHierarchy(_holeDegrees);
|
|
217
|
+
}) || [];
|
|
218
|
+
|
|
219
|
+
const polygonHierarchy = new this.Cesium.PolygonHierarchy(outerCartesian, holes);
|
|
220
|
+
|
|
221
|
+
return new this.Cesium.GeometryInstance({
|
|
222
|
+
id: item.id,
|
|
223
|
+
geometry: new this.Cesium.PolygonGeometry({
|
|
224
|
+
polygonHierarchy: polygonHierarchy,
|
|
225
|
+
}),
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
// 获取材质(在 updatePrimitive 中处理)
|
|
230
|
+
private getMaterial(item: any): any {
|
|
231
|
+
let material = this.materialManager.get({
|
|
232
|
+
themeKey: item.theme,
|
|
233
|
+
options: item,
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
if (!material) {
|
|
237
|
+
material = this.Cesium.Material.fromType('Color', {
|
|
238
|
+
color: new this.Cesium.Color(1.0, 0.0, 0.0, 1.0), // 默认红色
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
return material;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
// 更新图元
|
|
246
|
+
public updateGeometryInstance(_item: any): void {
|
|
247
|
+
let item = cloneDeep(_item);
|
|
248
|
+
|
|
249
|
+
const layer = this.layerMap.get(item.layerId);
|
|
250
|
+
if (!layer) {
|
|
251
|
+
console.warn(`没有找到图层 ${item.layerId}`);
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
let geometryInstanceInfo = layer.get(item.id);
|
|
256
|
+
layer.set(item.id, item);
|
|
257
|
+
if (!geometryInstanceInfo) {
|
|
258
|
+
console.warn(`没有找到图元 ${item.id} 在图层 ${item.layerId} 中`);
|
|
259
|
+
return;
|
|
260
|
+
}
|
|
261
|
+
if (geometryInstanceInfo.theme !== item.theme) {
|
|
262
|
+
//更新旧的主题
|
|
263
|
+
let oldThemePrimitive = this.PrimitiveThemeMap.get(geometryInstanceInfo.theme);
|
|
264
|
+
oldThemePrimitive?.geometryInstances.delete(item.id);
|
|
265
|
+
oldThemePrimitive?.ids.delete(item.id);
|
|
266
|
+
this.updatePrimitive(geometryInstanceInfo);
|
|
267
|
+
}
|
|
268
|
+
//更新新的主题
|
|
269
|
+
let themePrimitive = this.carateThemePrimitive(item);
|
|
270
|
+
if (themePrimitive) {
|
|
271
|
+
const geometryInstance = this.createGeometryInstance(item);
|
|
272
|
+
themePrimitive.geometryInstances.set(item.id, geometryInstance);
|
|
273
|
+
themePrimitive.ids.set(item.id, item);
|
|
274
|
+
// 调用更新图元的方法
|
|
275
|
+
this.updatePrimitive(item);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// 删除图元
|
|
280
|
+
public deleteGeometryInstance(data: Array<{ layerId: string; ids: string[] }>): void {
|
|
281
|
+
let themeMap = new Set();
|
|
282
|
+
data.forEach((item) => {
|
|
283
|
+
let { layerId, ids } = item;
|
|
284
|
+
const layer = this.layerMap.get(layerId);
|
|
285
|
+
if (!layer) {
|
|
286
|
+
console.warn(`没有找到图层 ${layerId}`);
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
ids.forEach((id) => {
|
|
290
|
+
let geometryInstanceInfo = layer.get(id);
|
|
291
|
+
|
|
292
|
+
if (!geometryInstanceInfo) {
|
|
293
|
+
console.warn(`没有找到图元 ${id} 在图层 ${layerId} 中`);
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
//更新新的主题
|
|
298
|
+
let themePrimitive = this.PrimitiveThemeMap.get(geometryInstanceInfo.theme);
|
|
299
|
+
if (themePrimitive) {
|
|
300
|
+
themePrimitive.geometryInstances.delete(geometryInstanceInfo.id);
|
|
301
|
+
themePrimitive.ids.delete(geometryInstanceInfo.id);
|
|
302
|
+
// 调用更新图元的方法
|
|
303
|
+
themeMap.add(geometryInstanceInfo);
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
});
|
|
307
|
+
Array.from(themeMap.values()).forEach((item) => {
|
|
308
|
+
this.updatePrimitive(item);
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
// 添加图元
|
|
312
|
+
public addGeometryInstance(_item: any): void {
|
|
313
|
+
let item = cloneDeep(_item);
|
|
314
|
+
|
|
315
|
+
const layer = this.layerMap.get(item.layerId);
|
|
316
|
+
if (!layer) {
|
|
317
|
+
console.warn(`没有找到图层 ${item.layerId}`);
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
let geometryInstanceInfo = layer.get(item.id);
|
|
322
|
+
|
|
323
|
+
if (geometryInstanceInfo) {
|
|
324
|
+
console.warn(`图元 ${item.id} 已经存在图层 ${item.layerId} 中`);
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
layer.set(item.id, item);
|
|
328
|
+
//更新新的主题
|
|
329
|
+
let themePrimitive = this.carateThemePrimitive(item);
|
|
330
|
+
if (themePrimitive) {
|
|
331
|
+
const geometryInstance = this.createGeometryInstance(item);
|
|
332
|
+
themePrimitive.geometryInstances.set(item.id, geometryInstance);
|
|
333
|
+
themePrimitive.ids.set(item.id, item);
|
|
334
|
+
// 调用更新图元的方法
|
|
335
|
+
this.updatePrimitive(item);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
// 创建外观
|
|
340
|
+
private createAppearance(item: any) {
|
|
341
|
+
let material = this.getMaterial({ theme: item.theme });
|
|
342
|
+
let appearance;
|
|
343
|
+
if (item.category === 'polyline') {
|
|
344
|
+
appearance = new this.Cesium.PolylineMaterialAppearance({
|
|
345
|
+
material: material, // 传入材质
|
|
346
|
+
translucent: true,
|
|
347
|
+
});
|
|
348
|
+
} else if (item.category === 'polygon') {
|
|
349
|
+
appearance = new this.Cesium.MaterialAppearance({
|
|
350
|
+
material: material,
|
|
351
|
+
translucent: true,
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
return appearance;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
// 根据 theme 更新对应的 Primitive
|
|
358
|
+
private updatePrimitive(item: any): void {
|
|
359
|
+
const themePrimitive = this.PrimitiveThemeMap.get(item.theme);
|
|
360
|
+
if (!themePrimitive) {
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// 如果当前没有创建 Primitive,则创建新的
|
|
365
|
+
if (themePrimitive.Primitive) {
|
|
366
|
+
this.viewer.scene.primitives.remove(themePrimitive.Primitive);
|
|
367
|
+
themePrimitive.Primitive = null;
|
|
368
|
+
}
|
|
369
|
+
// 更新已存在的 Primitive
|
|
370
|
+
let arrayFromMap = Array.from(themePrimitive.geometryInstances, ([key, value]) => ({
|
|
371
|
+
key,
|
|
372
|
+
value,
|
|
373
|
+
}));
|
|
374
|
+
// let layer = this.hideLayerMap.get(item.layerId);
|
|
375
|
+
let geometryInstances = arrayFromMap
|
|
376
|
+
.filter((n) => {
|
|
377
|
+
return !Array.from(this.hideLayerMap.values()).some((layer) => layer.has(n.key));
|
|
378
|
+
})
|
|
379
|
+
.map((n) => {
|
|
380
|
+
return n.value;
|
|
381
|
+
});
|
|
382
|
+
if (geometryInstances.length <= 0) return;
|
|
383
|
+
if (item.category === 'polyline') {
|
|
384
|
+
themePrimitive.Primitive = new this.Cesium.GroundPolylinePrimitive({
|
|
385
|
+
geometryInstances: geometryInstances, // 使用所有的 GeometryInstance
|
|
386
|
+
appearance: themePrimitive.appearance,
|
|
387
|
+
});
|
|
388
|
+
this.viewer.scene.primitives.add(themePrimitive.Primitive); // 添加到场景
|
|
389
|
+
} else {
|
|
390
|
+
themePrimitive.Primitive = new this.Cesium.GroundPrimitive({
|
|
391
|
+
geometryInstances: geometryInstances, // 使用所有的 GeometryInstance
|
|
392
|
+
appearance: themePrimitive.appearance,
|
|
393
|
+
});
|
|
394
|
+
|
|
395
|
+
this.viewer.scene.primitives.add(themePrimitive.Primitive); // 添加到场景
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
//隐藏
|
|
400
|
+
public hideByLayerAndId(data: Array<{ layerId: string; ids: string[] }>) {
|
|
401
|
+
let themeMap = new Map();
|
|
402
|
+
|
|
403
|
+
data.forEach((item) => {
|
|
404
|
+
let { layerId, ids } = item;
|
|
405
|
+
let layer = this.hideLayerMap.get(layerId);
|
|
406
|
+
if (!layer) {
|
|
407
|
+
layer = new Set();
|
|
408
|
+
this.hideLayerMap.set(layerId, layer);
|
|
409
|
+
}
|
|
410
|
+
ids.forEach((value) => {
|
|
411
|
+
layer.add(value);
|
|
412
|
+
let info = this.getGeometryInstanceInfo(layerId, value);
|
|
413
|
+
if (info) themeMap.set(info.theme, info);
|
|
414
|
+
});
|
|
415
|
+
});
|
|
416
|
+
Array.from(themeMap.values()).forEach((item) => {
|
|
417
|
+
this.updatePrimitive(item);
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
//显示
|
|
422
|
+
public showByLayerAndId(data: Array<{ layerId: string; ids: string[] }>) {
|
|
423
|
+
let themeMap = new Map();
|
|
424
|
+
data.forEach((item) => {
|
|
425
|
+
let { layerId, ids } = item;
|
|
426
|
+
let layer = this.hideLayerMap.get(layerId);
|
|
427
|
+
if (!layer) {
|
|
428
|
+
layer = new Set();
|
|
429
|
+
this.hideLayerMap.set(layerId, layer);
|
|
430
|
+
}
|
|
431
|
+
ids.forEach((value) => {
|
|
432
|
+
layer.delete(value);
|
|
433
|
+
let info = this.getGeometryInstanceInfo(layerId, value);
|
|
434
|
+
if (info) themeMap.set(info.theme, info);
|
|
435
|
+
});
|
|
436
|
+
});
|
|
437
|
+
Array.from(themeMap.values()).forEach((item) => {
|
|
438
|
+
this.updatePrimitive(item);
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
//查询是否存在图元
|
|
443
|
+
public hasGeometryInstance(layerId: string, id: string) {
|
|
444
|
+
// 获取图层
|
|
445
|
+
const layer = this.layerMap.get(layerId);
|
|
446
|
+
if (!layer) {
|
|
447
|
+
return false;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// 获取图元
|
|
451
|
+
const geometryInstanceInfo = layer.get(id);
|
|
452
|
+
if (!geometryInstanceInfo) {
|
|
453
|
+
return false;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
let themePrimitive = this.PrimitiveThemeMap.get(geometryInstanceInfo.theme);
|
|
457
|
+
if (!themePrimitive) {
|
|
458
|
+
return false;
|
|
459
|
+
}
|
|
460
|
+
// 获取图元的几何体
|
|
461
|
+
const geometryInstance = themePrimitive.geometryInstances.get(id);
|
|
462
|
+
if (!geometryInstance) {
|
|
463
|
+
return false;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
return true;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
//查询图元信息
|
|
470
|
+
public getGeometryInstanceInfo(layerId: string, id: string) {
|
|
471
|
+
// 获取图层
|
|
472
|
+
const layer = this.layerMap.get(layerId);
|
|
473
|
+
if (!layer) {
|
|
474
|
+
return null;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// 获取图元
|
|
478
|
+
const geometryInstanceInfo = layer.get(id);
|
|
479
|
+
return geometryInstanceInfo;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
public focusOnGeometryInstance(layerId: string, id: string): void {
|
|
483
|
+
// 获取图层
|
|
484
|
+
const layer = this.layerMap.get(layerId);
|
|
485
|
+
if (!layer) {
|
|
486
|
+
console.warn(`图层 ${layerId} 不存在`);
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
// 获取图元
|
|
491
|
+
const geometryInstanceInfo = layer.get(id);
|
|
492
|
+
if (!geometryInstanceInfo) {
|
|
493
|
+
console.warn(`没有找到图元 ${id} 在图层 ${layerId} 中`);
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
let themePrimitive = this.PrimitiveThemeMap.get(geometryInstanceInfo.theme);
|
|
498
|
+
if (!themePrimitive) {
|
|
499
|
+
console.warn(`没有找到 ${id} 图元相关的Primitive`);
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
// 获取图元的几何体
|
|
503
|
+
const geometryInstance = themePrimitive.geometryInstances.get(id);
|
|
504
|
+
if (!geometryInstance) {
|
|
505
|
+
console.warn(`没有找到图元的几何体 ${id}`);
|
|
506
|
+
return;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
const geometry = geometryInstance.geometry;
|
|
510
|
+
const positions = geometry._positions || geometry._polygonHierarchy.positions;
|
|
511
|
+
|
|
512
|
+
if (positions && positions.length > 0) {
|
|
513
|
+
// 计算包围盒的最小和最大点
|
|
514
|
+
let minX = positions[0].x,
|
|
515
|
+
minY = positions[0].y,
|
|
516
|
+
minZ = positions[0].z;
|
|
517
|
+
let maxX = positions[0].x,
|
|
518
|
+
maxY = positions[0].y,
|
|
519
|
+
maxZ = positions[0].z;
|
|
520
|
+
|
|
521
|
+
positions.forEach((position: any) => {
|
|
522
|
+
minX = Math.min(minX, position.x);
|
|
523
|
+
minY = Math.min(minY, position.y);
|
|
524
|
+
minZ = Math.min(minZ, position.z);
|
|
525
|
+
|
|
526
|
+
maxX = Math.max(maxX, position.x);
|
|
527
|
+
maxY = Math.max(maxY, position.y);
|
|
528
|
+
maxZ = Math.max(maxZ, position.z);
|
|
529
|
+
});
|
|
530
|
+
|
|
531
|
+
// 计算包围盒的中心和尺寸
|
|
532
|
+
const center = new this.Cesium.Cartesian3(
|
|
533
|
+
(minX + maxX) / 2,
|
|
534
|
+
(minY + maxY) / 2,
|
|
535
|
+
(minZ + maxZ) / 2,
|
|
536
|
+
);
|
|
537
|
+
const dimensions = new this.Cesium.Cartesian3(maxX - minX, maxY - minY, maxZ - minZ);
|
|
538
|
+
|
|
539
|
+
// 计算偏移量(使用包围盒的高度作为偏移)
|
|
540
|
+
const height = dimensions.z; // 高度对应 Z 轴
|
|
541
|
+
const offsetHeight = Math.abs(height || 1) * 1.5; // 使用包围盒高度的 1.5 倍作为偏移量
|
|
542
|
+
|
|
543
|
+
// 使用摄像机平滑定位到包围盒中心
|
|
544
|
+
this.viewer.camera.flyTo({
|
|
545
|
+
destination: center,
|
|
546
|
+
duration: 2, // 平滑移动的持续时间(秒)
|
|
547
|
+
complete: () => {
|
|
548
|
+
console.log(`已定位到图元 ${id}`);
|
|
549
|
+
},
|
|
550
|
+
offset: new this.Cesium.Cartesian3(0, 0, offsetHeight), // 使用动态计算的偏移高度
|
|
551
|
+
});
|
|
552
|
+
} else {
|
|
553
|
+
console.warn(`无法获取图元 ${id} 的顶点信息`);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}
|