@vtx/cs-map 1.0.89 → 1.0.91

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.
Files changed (51) hide show
  1. package/lib/assets/excavate_bottom_min.png +0 -0
  2. package/lib/assets/excavate_kuangqu.png +0 -0
  3. package/lib/cesium-tiles-layer/demo/assets/baseMapImg-1.png +0 -0
  4. package/lib/cesium-tiles-layer/demo/assets/baseMapImg.png +0 -0
  5. package/lib/cesium-tiles-layer/demo/assets/round.png +0 -0
  6. package/lib/cesium-tiles-layer/demo/assets/water.png +0 -0
  7. package/lib/cesium-tiles-layer/demo/index.css +4 -0
  8. package/lib/cesium-tiles-layer/demo/index.less +4 -0
  9. package/lib/circle-fly/index.js +25 -15
  10. package/lib/circle-fly/index.js.map +1 -1
  11. package/lib/excavation-analysis/TilesetCut.js +203 -0
  12. package/lib/excavation-analysis/TilesetCut.js.map +1 -0
  13. package/lib/excavation-analysis/hooks/useDrawHandler.js +142 -0
  14. package/lib/excavation-analysis/hooks/useDrawHandler.js.map +1 -0
  15. package/lib/excavation-analysis/hooks/useTerrainClipPlan.js +292 -0
  16. package/lib/excavation-analysis/hooks/useTerrainClipPlan.js.map +1 -0
  17. package/lib/excavation-analysis/hooks/useTileSetCut.js +31 -0
  18. package/lib/excavation-analysis/hooks/useTileSetCut.js.map +1 -0
  19. package/lib/excavation-analysis/index.js +84 -0
  20. package/lib/excavation-analysis/index.js.map +1 -0
  21. package/lib/excavation-analysis/style/css.js +4 -0
  22. package/lib/excavation-analysis/style/css.js.map +1 -0
  23. package/lib/excavation-analysis/style/index.css +0 -0
  24. package/lib/excavation-analysis/style/index.js +4 -0
  25. package/lib/excavation-analysis/style/index.js.map +1 -0
  26. package/lib/excavation-analysis/style/index.less +0 -0
  27. package/lib/fly-line-layer/FlyLineLayer.js +12 -9
  28. package/lib/fly-line-layer/FlyLineLayer.js.map +1 -1
  29. package/lib/highlight-layer/HighlightLayer.js +1 -1
  30. package/lib/highlight-layer/HighlightLayer.js.map +1 -1
  31. package/lib/map/Popup.js +27 -15
  32. package/lib/map/Popup.js.map +1 -1
  33. package/lib/map/base/imagery/geoq/GeoQImageryProvider.js +4 -4
  34. package/lib/map/base/imagery/geoq/GeoQImageryProvider.js.map +1 -1
  35. package/lib/map/base/imagery/tdt/JiangSuTdtImageryProvider.js +48 -0
  36. package/lib/map/base/imagery/tdt/JiangSuTdtImageryProvider.js.map +1 -0
  37. package/lib/map/base/index.js +25 -2
  38. package/lib/map/base/index.js.map +1 -1
  39. package/lib/map/index.js +31 -22
  40. package/lib/map/index.js.map +1 -1
  41. package/lib/split-screen/index.js +102 -0
  42. package/lib/split-screen/index.js.map +1 -0
  43. package/lib/split-screen/style/css.js +2 -0
  44. package/lib/split-screen/style/css.js.map +1 -0
  45. package/lib/split-screen/style/index.js +2 -0
  46. package/lib/split-screen/style/index.js.map +1 -0
  47. package/lib/wall/WallGeometry.js +5 -3
  48. package/lib/wall/WallGeometry.js.map +1 -1
  49. package/lib/water-surface-layer/WaterSurfaceLayer.js +25 -8
  50. package/lib/water-surface-layer/WaterSurfaceLayer.js.map +1 -1
  51. package/package.json +1 -1
@@ -0,0 +1,292 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _react = require("react");
8
+ var _cesium = require("cesium");
9
+ var useTerrainClipPlan = function useTerrainClipPlan(props) {
10
+ var viewer = props.viewer;
11
+ var showResult = (0, _react.useRef)(true);
12
+ var wellWall = (0, _react.useRef)();
13
+ var bottomSurface = (0, _react.useRef)();
14
+ var wellData = (0, _react.useRef)();
15
+ var excavateMinHeight = (0, _react.useRef)(9999);
16
+ var wallImgStr = (0, _react.useRef)();
17
+ var bottomImgStr = (0, _react.useRef)();
18
+ var splitNumber = (0, _react.useRef)();
19
+ var heightNum = (0, _react.useRef)(0);
20
+ var positionsCur = (0, _react.useRef)([]);
21
+
22
+ // 设置是否显示
23
+ var show = function show(isShow) {
24
+ showResult.current = isShow;
25
+ if (viewer.scene.globe.clippingPlanes) viewer.scene.globe.clippingPlanes.enabled = isShow;
26
+ switchExcavate(isShow);
27
+ };
28
+ var switchExcavate = function switchExcavate(isSHow) {
29
+ if (!bottomSurface.current) return;
30
+ if (isSHow) {
31
+ viewer.scene.globe.material = _cesium.Material.fromType("WaJue");
32
+ if (wellWall.current) wellWall.current.show = isSHow;
33
+ bottomSurface.current.show = isSHow;
34
+ } else {
35
+ viewer.globe.material = null;
36
+ if (wellWall.current) wellWall.current.show = !isSHow;
37
+ bottomSurface.current.show = !isSHow;
38
+ }
39
+ };
40
+ var updateExcavateDepth = function updateExcavateDepth(height) {
41
+ if (!wellData.current) return;
42
+ if (bottomSurface.current) viewer.scene.primitives.remove(bottomSurface.current);
43
+ if (wellWall.current) viewer.scene.primitives.remove(wellWall.current);
44
+ var lerpos = wellData.current.lerp_pos;
45
+ var res = [];
46
+ for (var i = 0; i < lerpos.length; i++) {
47
+ res.push(_cesium.Cartesian3.fromRadians(lerpos[i].latitude, excavateMinHeight.current - height));
48
+ }
49
+ heightNum.current = height;
50
+ updateData(positionsCur.current);
51
+ };
52
+
53
+ // 开挖分析
54
+ var start = function start(attrs) {
55
+ var wallImg = attrs.wallImg,
56
+ splitNum = attrs.splitNum,
57
+ height = attrs.height,
58
+ positions = attrs.positions,
59
+ bottomImg = attrs.bottomImg;
60
+ wallImgStr.current = wallImg;
61
+ splitNumber.current = splitNum;
62
+ heightNum.current = height;
63
+ bottomImgStr.current = bottomImg;
64
+ positionsCur.current = positions;
65
+ updateData(positionsCur.current);
66
+ };
67
+ var createWell = function createWell(data) {
68
+ if (viewer.terrainProvider._layers) {
69
+ createBottomSurface(data.bottom_pos);
70
+ (0, _cesium.when)((0, _cesium.sampleTerrainMostDetailed)(viewer.terrainProvider, data.lerp_pos), function (arr) {
71
+ var no_height_top = [];
72
+ for (var i = 0; i < arr.length; i++) {
73
+ var s = _cesium.Cartesian3.fromRadians(arr[i].longitude, arr[i].latitude, arr[i].height);
74
+ no_height_top.push(s);
75
+ }
76
+ createWellWall(data.bottom_pos, no_height_top);
77
+ });
78
+ } else {
79
+ createBottomSurface(data.bottom_pos);
80
+ createWellWall(data.bottom_pos, data.no_height_top);
81
+ }
82
+ };
83
+ var createBottomSurface = function createBottomSurface(bottom_pos) {
84
+ if (bottom_pos.length) {
85
+ var minHeight = getMinHeight(bottom_pos);
86
+ var points = [];
87
+ for (var i = 0; i < bottom_pos.length; i++) {
88
+ var p = ellipsoidToLonLat(bottom_pos[i]);
89
+ points.push(p.longitude);
90
+ points.push(p.latitude);
91
+ points.push(minHeight);
92
+ }
93
+ if (!points) return;
94
+ var polygon = new _cesium.PolygonGeometry({
95
+ polygonHierarchy: new _cesium.PolygonHierarchy(_cesium.Cartesian3.fromDegreesArrayHeights(points)),
96
+ perPositionHeight: true
97
+ });
98
+ var geometry = _cesium.PolygonGeometry.createGeometry(polygon);
99
+ var material = new _cesium.Material({
100
+ fabric: {
101
+ type: 'Image',
102
+ uniforms: {
103
+ image: bottomImgStr.current
104
+ }
105
+ }
106
+ });
107
+ var appearance = new _cesium.MaterialAppearance({
108
+ translucent: false,
109
+ flat: true,
110
+ material: material
111
+ });
112
+ if (!geometry) return;
113
+ bottomSurface.current = new _cesium.Primitive({
114
+ geometryInstances: new _cesium.GeometryInstance({
115
+ geometry: geometry
116
+ }),
117
+ appearance: appearance,
118
+ asynchronous: false
119
+ });
120
+ viewer.scene.primitives.add(bottomSurface.current);
121
+ }
122
+ };
123
+ var createWellWall = function createWellWall(bottom_pos, no_height_topt) {
124
+ var minHeight = getMinHeight(bottom_pos);
125
+ var maxHeights = [];
126
+ var minHeights = [];
127
+ for (var i = 0; i < no_height_topt.length; i++) {
128
+ maxHeights.push(ellipsoidToLonLat(no_height_topt[i]).altitude);
129
+ minHeights.push(minHeight);
130
+ }
131
+ var wall = new _cesium.WallGeometry({
132
+ positions: no_height_topt,
133
+ maximumHeights: maxHeights,
134
+ minimumHeights: minHeights
135
+ });
136
+ var geometry = _cesium.WallGeometry.createGeometry(wall);
137
+ var material = new _cesium.Material({
138
+ fabric: {
139
+ type: 'Image',
140
+ uniforms: {
141
+ image: wallImgStr.current
142
+ }
143
+ }
144
+ });
145
+ var appearance = new _cesium.MaterialAppearance({
146
+ translucent: false,
147
+ flat: true,
148
+ material: material
149
+ });
150
+ if (geometry) {
151
+ var primitive = new _cesium.Primitive({
152
+ geometryInstances: new _cesium.GeometryInstance({
153
+ geometry: geometry,
154
+ attributes: {
155
+ color: _cesium.ColorGeometryInstanceAttribute.fromColor(_cesium.Color.GREY)
156
+ },
157
+ id: 'PitWall'
158
+ }),
159
+ appearance: appearance,
160
+ asynchronous: false
161
+ });
162
+ wellWall.current = primitive;
163
+ viewer.scene.primitives.add(primitive);
164
+ }
165
+ };
166
+ var getMinHeight = function getMinHeight(cartesians) {
167
+ var _minPoint;
168
+ var minHeight = 5000000;
169
+ var minPoint = null;
170
+ for (var i = 0; i < cartesians.length; i++) {
171
+ var height = cartesians[i]['z'];
172
+ if (height < minHeight) {
173
+ minHeight = height;
174
+ minPoint = ellipsoidToLonLat(cartesians[i]);
175
+ }
176
+ }
177
+ return (_minPoint = minPoint) === null || _minPoint === void 0 ? void 0 : _minPoint.altitude;
178
+ };
179
+ var ellipsoidToLonLat = function ellipsoidToLonLat(cartesian) {
180
+ var ellipsoid = viewer.scene.globe.ellipsoid;
181
+ var cartesian3 = new _cesium.Cartesian3(cartesian.x, cartesian.y, cartesian.z);
182
+ var cartographic = ellipsoid.cartesianToCartographic(cartesian3);
183
+ var latitude = _cesium.Math.toDegrees(cartographic.latitude);
184
+ var longitude = _cesium.Math.toDegrees(cartographic.longitude);
185
+ var altitude = cartographic.height;
186
+ return {
187
+ longitude: longitude,
188
+ latitude: latitude,
189
+ altitude: altitude
190
+ };
191
+ };
192
+
193
+ // 更新开挖深度
194
+ var updateData = function updateData(points) {
195
+ clear();
196
+ var planes = [];
197
+ var pointsLength = points.length;
198
+ // 计算分量差
199
+ // const subtr = Cartesian3.subtract(positions[0], positions[1], new Cartesian3())
200
+ excavateMinHeight.current = 9999;
201
+ for (var i = 0; i < pointsLength; ++i) {
202
+ var nextIndex = (i + 1) % pointsLength;
203
+ // 计算中间值
204
+ var midpoint = _cesium.Cartesian3.midpoint(points[i], points[nextIndex], new _cesium.Cartesian3());
205
+ var catographic = _cesium.Cartographic.fromCartesian(points[i]);
206
+ var height = viewer.scene.globe.getHeight(catographic) || catographic.height;
207
+ height < excavateMinHeight.current && (excavateMinHeight.current = height);
208
+ var up = _cesium.Cartesian3.normalize(midpoint, new _cesium.Cartesian3());
209
+ var right = _cesium.Cartesian3.subtract(points[nextIndex], midpoint, new _cesium.Cartesian3());
210
+ right = _cesium.Cartesian3.normalize(right, right);
211
+ var cross = _cesium.Cartesian3.cross(right, up, new _cesium.Cartesian3());
212
+ cross = _cesium.Cartesian3.normalize(cross, cross);
213
+ var plane = new _cesium.Plane(cross, 0.0);
214
+ var distance = _cesium.Plane.getPointDistance(plane, midpoint);
215
+ planes.push(new _cesium.ClippingPlane(cross, distance));
216
+ }
217
+ viewer.scene.globe.clippingPlanes = new _cesium.ClippingPlaneCollection({
218
+ planes: planes,
219
+ edgeWidth: 1,
220
+ edgeColor: _cesium.Color.WHITE,
221
+ enabled: true,
222
+ unionClippingRegions: false
223
+ });
224
+ prepareWell(points);
225
+ if (wellData.current) {
226
+ createWell(wellData.current);
227
+ }
228
+ };
229
+
230
+ // 清除开挖分析结果
231
+ var clear = function clear() {
232
+ var _viewer$scene$globe$c;
233
+ if (viewer.scene.globe.clippingPlanes) {
234
+ viewer.scene.globe.clippingPlanes.enabled = !1;
235
+ viewer.scene.globe.clippingPlanes.removeAll();
236
+ }
237
+ if (viewer.scene.globe.clippingPlanes && !((_viewer$scene$globe$c = viewer.scene.globe.clippingPlanes) !== null && _viewer$scene$globe$c !== void 0 && _viewer$scene$globe$c.isDestroyed)) {
238
+ viewer.scene.globe.clippingPlanes.destroy();
239
+ }
240
+ viewer.scene.globe.clippingPlanes = undefined;
241
+ if (bottomSurface.current) viewer.scene.primitives.remove(bottomSurface.current);
242
+ if (wellWall.current) viewer.scene.primitives.remove(wellWall.current);
243
+ bottomSurface.current = undefined;
244
+ wellWall.current = undefined;
245
+ viewer.scene.render();
246
+ };
247
+ var prepareWell = function prepareWell(points) {
248
+ var len = points.length;
249
+ if (len !== 0) {
250
+ var no_height_top = [];
251
+ var bottom_pos = [];
252
+ var lerp_pos = [];
253
+ var diff = excavateMinHeight.current - heightNum.current;
254
+ for (var i = 0; i < len; i++) {
255
+ var nextIndex = i === len - 1 ? 0 : i + 1;
256
+ var currentCattesian = _cesium.Cartographic.fromCartesian(points[i]);
257
+ var nextCartorghic = _cesium.Cartographic.fromCartesian(points[nextIndex]);
258
+ var currLonLat = [currentCattesian.longitude, currentCattesian.latitude];
259
+ var nextLonLat = [nextCartorghic.longitude, nextCartorghic.latitude];
260
+ if (i === 0) {
261
+ lerp_pos.push(new _cesium.Cartographic(currLonLat[0], currLonLat[1]));
262
+ bottom_pos.push(_cesium.Cartesian3.fromRadians(currLonLat[0], currLonLat[1], diff));
263
+ no_height_top.push(_cesium.Cartesian3.fromRadians(currLonLat[0], currLonLat[1], 0));
264
+ }
265
+ if (!splitNumber.current) return;
266
+ for (var p = 1; p <= splitNumber.current; p++) {
267
+ var firstLerp = _cesium.Math.lerp(currLonLat[0], nextLonLat[0], p / splitNumber.current);
268
+ var lastLerp = _cesium.Math.lerp(currLonLat[1], nextLonLat[1], p / splitNumber.current);
269
+ if (i !== len - 1 || p !== splitNumber.current) {
270
+ lerp_pos.push(new _cesium.Cartographic(firstLerp, lastLerp));
271
+ bottom_pos.push(_cesium.Cartesian3.fromRadians(firstLerp, lastLerp, diff));
272
+ no_height_top.push(_cesium.Cartesian3.fromRadians(firstLerp, lastLerp, 0));
273
+ }
274
+ }
275
+ }
276
+ wellData.current = {
277
+ lerp_pos: lerp_pos,
278
+ bottom_pos: bottom_pos,
279
+ no_height_top: no_height_top
280
+ };
281
+ }
282
+ };
283
+ return {
284
+ start: start,
285
+ clear: clear,
286
+ updateData: updateData,
287
+ updateExcavateDepth: updateExcavateDepth,
288
+ show: show
289
+ };
290
+ };
291
+ var _default = exports["default"] = useTerrainClipPlan;
292
+ //# sourceMappingURL=useTerrainClipPlan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTerrainClipPlan.js","names":["_react","require","_cesium","useTerrainClipPlan","props","viewer","showResult","useRef","wellWall","bottomSurface","wellData","excavateMinHeight","wallImgStr","bottomImgStr","splitNumber","heightNum","positionsCur","show","isShow","current","scene","globe","clippingPlanes","enabled","switchExcavate","isSHow","material","Material","fromType","updateExcavateDepth","height","primitives","remove","lerpos","lerp_pos","res","i","length","push","Cartesian3","fromRadians","latitude","updateData","start","attrs","wallImg","splitNum","positions","bottomImg","createWell","data","terrainProvider","_layers","createBottomSurface","bottom_pos","when","sampleTerrainMostDetailed","arr","no_height_top","s","longitude","createWellWall","minHeight","getMinHeight","points","p","ellipsoidToLonLat","polygon","PolygonGeometry","polygonHierarchy","PolygonHierarchy","fromDegreesArrayHeights","perPositionHeight","geometry","createGeometry","fabric","type","uniforms","image","appearance","MaterialAppearance","translucent","flat","Primitive","geometryInstances","GeometryInstance","asynchronous","add","no_height_topt","maxHeights","minHeights","altitude","wall","WallGeometry","maximumHeights","minimumHeights","primitive","attributes","color","ColorGeometryInstanceAttribute","fromColor","Color","GREY","id","cartesians","_minPoint","minPoint","cartesian","ellipsoid","cartesian3","x","y","z","cartographic","cartesianToCartographic","CesiumMath","toDegrees","clear","planes","pointsLength","nextIndex","midpoint","catographic","Cartographic","fromCartesian","getHeight","up","normalize","right","subtract","cross","plane","Plane","distance","getPointDistance","ClippingPlane","ClippingPlaneCollection","edgeWidth","edgeColor","WHITE","unionClippingRegions","prepareWell","_viewer$scene$globe$c","removeAll","isDestroyed","destroy","undefined","render","len","diff","currentCattesian","nextCartorghic","currLonLat","nextLonLat","firstLerp","lerp","lastLerp","_default","exports"],"sources":["excavation-analysis/hooks/useTerrainClipPlan.js"],"sourcesContent":["import { useRef } from 'react';\nimport {\n Cartographic,\n Cartesian3,\n Math as CesiumMath,\n when,\n sampleTerrainMostDetailed,\n PolygonGeometry,\n PolygonHierarchy,\n Material,\n MaterialAppearance,\n Primitive,\n GeometryInstance,\n WallGeometry,\n ColorGeometryInstanceAttribute,\n Color,\n Plane,\n ClippingPlane,\n ClippingPlaneCollection\n} from 'cesium';\n\nconst useTerrainClipPlan = (props) => {\n const { viewer } = props\n const showResult = useRef(true)\n const wellWall = useRef()\n const bottomSurface = useRef()\n const wellData = useRef()\n const excavateMinHeight = useRef(9999)\n const wallImgStr = useRef()\n const bottomImgStr = useRef()\n const splitNumber = useRef()\n const heightNum = useRef(0)\n const positionsCur = useRef([])\n\n // 设置是否显示\n const show = (isShow) => {\n showResult.current = isShow\n if (viewer.scene.globe.clippingPlanes) viewer.scene.globe.clippingPlanes.enabled = isShow\n switchExcavate(isShow)\n }\n\n const switchExcavate = (isSHow) => {\n if (!bottomSurface.current) return\n if (isSHow) {\n viewer.scene.globe.material = Material.fromType(\"WaJue\")\n if (wellWall.current) wellWall.current.show = isSHow\n bottomSurface.current.show = isSHow\n } else {\n viewer.globe.material = null\n if (wellWall.current) wellWall.current.show = !isSHow\n bottomSurface.current.show = !isSHow\n }\n }\n\n\n const updateExcavateDepth = (height) => {\n if (!wellData.current) return\n\n if (bottomSurface.current) viewer.scene.primitives.remove(bottomSurface.current)\n if (wellWall.current) viewer.scene.primitives.remove(wellWall.current)\n\n const lerpos = wellData.current.lerp_pos\n const res = []\n for (let i = 0; i < lerpos.length; i++){\n res.push(Cartesian3.fromRadians(lerpos[i].latitude, excavateMinHeight.current - height))\n }\n heightNum.current = height\n updateData(positionsCur.current)\n }\n\n // 开挖分析\n const start = (attrs) => {\n const { wallImg, splitNum, height, positions, bottomImg } = attrs\n wallImgStr.current = wallImg\n splitNumber.current = splitNum\n heightNum.current = height\n bottomImgStr.current = bottomImg\n positionsCur.current = positions\n updateData(positionsCur.current)\n }\n\n const createWell = (data) => {\n if (viewer.terrainProvider._layers) {\n createBottomSurface(data.bottom_pos);\n when(sampleTerrainMostDetailed(viewer.terrainProvider, data.lerp_pos), function (arr) {\n const no_height_top = []\n for (let i = 0; i < arr.length; i++) {\n const s = Cartesian3.fromRadians(arr[i].longitude, arr[i].latitude, arr[i].height)\n no_height_top.push(s)\n }\n createWellWall(data.bottom_pos, no_height_top)\n })\n } else {\n createBottomSurface(data.bottom_pos)\n createWellWall(data.bottom_pos, data.no_height_top)\n }\n }\n\n const createBottomSurface = (bottom_pos) => {\n if (bottom_pos.length) {\n const minHeight = getMinHeight(bottom_pos)\n const points = []\n for (let i = 0; i < bottom_pos.length; i++) {\n const p = ellipsoidToLonLat(bottom_pos[i])\n points.push(p.longitude)\n points.push(p.latitude)\n points.push(minHeight)\n }\n if (!points) return\n const polygon = new PolygonGeometry({\n polygonHierarchy: new PolygonHierarchy(\n Cartesian3.fromDegreesArrayHeights(points)\n ),\n perPositionHeight: true\n })\n const geometry = PolygonGeometry.createGeometry(polygon)\n const material = new Material({\n fabric: {\n type: 'Image',\n uniforms: {\n image: bottomImgStr.current\n }\n }\n })\n const appearance = new MaterialAppearance({\n translucent: false,\n flat: true,\n material\n })\n\n if (!geometry) return\n bottomSurface.current = new Primitive({\n geometryInstances: new GeometryInstance({\n geometry\n }),\n appearance,\n asynchronous: false\n })\n viewer.scene.primitives.add(bottomSurface.current)\n }\n }\n\n const createWellWall = (bottom_pos, no_height_topt) => {\n const minHeight = getMinHeight(bottom_pos)\n const maxHeights = []\n const minHeights = []\n for (let i = 0; i < no_height_topt.length; i++) {\n maxHeights.push(ellipsoidToLonLat(no_height_topt[i]).altitude)\n minHeights.push(minHeight)\n }\n const wall = new WallGeometry({\n positions: no_height_topt,\n maximumHeights: maxHeights,\n minimumHeights: minHeights,\n })\n const geometry = WallGeometry.createGeometry(wall)\n\n const material = new Material({\n fabric: {\n type: 'Image',\n uniforms: {\n image: wallImgStr.current\n }\n }\n })\n const appearance = new MaterialAppearance({\n translucent: false,\n flat: true,\n material\n })\n if (geometry) {\n const primitive = new Primitive({\n geometryInstances: new GeometryInstance({\n geometry,\n attributes: {\n color: ColorGeometryInstanceAttribute.fromColor(Color.GREY)\n },\n id: 'PitWall'\n }),\n appearance,\n asynchronous: false\n })\n wellWall.current = primitive\n viewer.scene.primitives.add(primitive)\n }\n }\n\n const getMinHeight = (cartesians) => {\n let minHeight = 5000000\n let minPoint = null\n for (let i = 0; i < cartesians.length; i++) {\n const height = cartesians[i]['z']\n if (height < minHeight) {\n minHeight = height\n minPoint = ellipsoidToLonLat(cartesians[i])\n }\n }\n return minPoint?.altitude\n }\n\n const ellipsoidToLonLat = (cartesian) => {\n const ellipsoid = viewer.scene.globe.ellipsoid\n const cartesian3 = new Cartesian3(cartesian.x, cartesian.y, cartesian.z)\n const cartographic = ellipsoid.cartesianToCartographic(cartesian3)\n const latitude = CesiumMath.toDegrees(cartographic.latitude)\n const longitude = CesiumMath.toDegrees(cartographic.longitude)\n const altitude = cartographic.height\n return {\n longitude,\n latitude,\n altitude\n }\n }\n\n // 更新开挖深度\n const updateData = (points) => {\n clear()\n const planes = []\n const pointsLength = points.length\n // 计算分量差\n // const subtr = Cartesian3.subtract(positions[0], positions[1], new Cartesian3())\n excavateMinHeight.current = 9999\n\n for (let i = 0; i < pointsLength; ++i) {\n const nextIndex = (i + 1) % pointsLength\n // 计算中间值\n const midpoint = Cartesian3.midpoint(points[i], points[nextIndex], new Cartesian3())\n\n const catographic = Cartographic.fromCartesian(points[i])\n const height = viewer.scene.globe.getHeight(catographic) || catographic.height\n height < excavateMinHeight.current && (excavateMinHeight.current = height)\n\n const up = Cartesian3.normalize(midpoint, new Cartesian3())\n let right = Cartesian3.subtract(points[nextIndex], midpoint, new Cartesian3())\n right = Cartesian3.normalize(right, right)\n let cross = Cartesian3.cross(right, up, new Cartesian3())\n cross = Cartesian3.normalize(cross, cross)\n const plane = new Plane(cross, 0.0)\n const distance = Plane.getPointDistance(plane, midpoint)\n planes.push(new ClippingPlane(cross, distance))\n }\n viewer.scene.globe.clippingPlanes = new ClippingPlaneCollection({\n planes,\n edgeWidth: 1,\n edgeColor: Color.WHITE,\n enabled: true,\n unionClippingRegions: false\n })\n\n prepareWell(points)\n if (wellData.current) {\n createWell(wellData.current)\n }\n }\n\n // 清除开挖分析结果\n const clear = () => {\n if (viewer.scene.globe.clippingPlanes) {\n viewer.scene.globe.clippingPlanes.enabled = !1\n viewer.scene.globe.clippingPlanes.removeAll()\n }\n if (viewer.scene.globe.clippingPlanes && !viewer.scene.globe.clippingPlanes?.isDestroyed) {\n viewer.scene.globe.clippingPlanes.destroy()\n }\n viewer.scene.globe.clippingPlanes = undefined\n if (bottomSurface.current) viewer.scene.primitives.remove(bottomSurface.current)\n if (wellWall.current) viewer.scene.primitives.remove(wellWall.current)\n bottomSurface.current = undefined\n wellWall.current = undefined\n viewer.scene.render()\n }\n\n const prepareWell = (points) => {\n const len = points.length\n if (len !== 0) {\n const no_height_top = []\n const bottom_pos = []\n const lerp_pos = []\n const diff = excavateMinHeight.current - heightNum.current\n for (let i = 0; i < len; i++) {\n const nextIndex = i === len - 1 ? 0 : i + 1\n const currentCattesian = Cartographic.fromCartesian(points[i])\n const nextCartorghic = Cartographic.fromCartesian(points[nextIndex])\n const currLonLat = [currentCattesian.longitude, currentCattesian.latitude]\n const nextLonLat = [nextCartorghic.longitude, nextCartorghic.latitude]\n\n if (i === 0) {\n lerp_pos.push(new Cartographic(currLonLat[0], currLonLat[1]))\n bottom_pos.push(Cartesian3.fromRadians(currLonLat[0], currLonLat[1], diff))\n no_height_top.push(Cartesian3.fromRadians(currLonLat[0], currLonLat[1], 0))\n }\n\n if (!splitNumber.current) return\n\n for (let p = 1; p <= splitNumber.current; p++) {\n const firstLerp = CesiumMath.lerp(currLonLat[0], nextLonLat[0], p / splitNumber.current)\n const lastLerp = CesiumMath.lerp(currLonLat[1], nextLonLat[1], p / splitNumber.current)\n if (i !== len - 1 || p !== splitNumber.current) {\n lerp_pos.push(new Cartographic(firstLerp, lastLerp))\n bottom_pos.push(Cartesian3.fromRadians(firstLerp, lastLerp, diff))\n no_height_top.push(Cartesian3.fromRadians(firstLerp, lastLerp, 0))\n }\n }\n }\n wellData.current = {\n lerp_pos,\n bottom_pos,\n no_height_top\n }\n }\n }\n\n return { start, clear, updateData, updateExcavateDepth, show }\n}\n\nexport default useTerrainClipPlan;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAoBA,IAAME,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,KAAK,EAAK;EAClC,IAAQC,MAAM,GAAKD,KAAK,CAAhBC,MAAM;EACd,IAAMC,UAAU,GAAG,IAAAC,aAAM,EAAC,IAAI,CAAC;EAC/B,IAAMC,QAAQ,GAAG,IAAAD,aAAM,EAAC,CAAC;EACzB,IAAME,aAAa,GAAG,IAAAF,aAAM,EAAC,CAAC;EAC9B,IAAMG,QAAQ,GAAG,IAAAH,aAAM,EAAC,CAAC;EACzB,IAAMI,iBAAiB,GAAG,IAAAJ,aAAM,EAAC,IAAI,CAAC;EACtC,IAAMK,UAAU,GAAG,IAAAL,aAAM,EAAC,CAAC;EAC3B,IAAMM,YAAY,GAAG,IAAAN,aAAM,EAAC,CAAC;EAC7B,IAAMO,WAAW,GAAG,IAAAP,aAAM,EAAC,CAAC;EAC5B,IAAMQ,SAAS,GAAG,IAAAR,aAAM,EAAC,CAAC,CAAC;EAC3B,IAAMS,YAAY,GAAG,IAAAT,aAAM,EAAC,EAAE,CAAC;;EAE/B;EACA,IAAMU,IAAI,GAAG,SAAPA,IAAIA,CAAIC,MAAM,EAAK;IACrBZ,UAAU,CAACa,OAAO,GAAGD,MAAM;IAC3B,IAAIb,MAAM,CAACe,KAAK,CAACC,KAAK,CAACC,cAAc,EAAEjB,MAAM,CAACe,KAAK,CAACC,KAAK,CAACC,cAAc,CAACC,O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;IAAEf,KAAK,EAALA,KAAK;IAAE0E,KAAK,EAALA,KAAK;IAAE3E,UAAU,EAAVA,UAAU;IAAEb,mBAAmB,EAAnBA,mBAAmB;IAAEZ,IAAI,EAAJA;EAAK,CAAC;AAClE,CAAC;AAAA,IAAA4I,QAAA,GAAAC,OAAA,cAEc3J,kBAAkB","ignoreList":[]}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = void 0;
7
+ var _react = require("react");
8
+ var _TilesetCut = _interopRequireDefault(require("../TilesetCut"));
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
10
+ var useTileSetCut = function useTileSetCut(props) {
11
+ var viewer = props.viewer,
12
+ sceneId = props.sceneId;
13
+ var cutToolRef = (0, _react.useRef)();
14
+ var loadTileSetCut = function loadTileSetCut() {
15
+ if (cutToolRef.current) {
16
+ return cutToolRef.current;
17
+ }
18
+ if (sceneId) {
19
+ var layer = viewer.getLayerByKey(sceneId);
20
+ if (layer) {
21
+ cutToolRef.current = new _TilesetCut["default"](layer);
22
+ return cutToolRef.current;
23
+ }
24
+ }
25
+ };
26
+ return {
27
+ loadTileSetCut: loadTileSetCut
28
+ };
29
+ };
30
+ var _default = exports["default"] = useTileSetCut;
31
+ //# sourceMappingURL=useTileSetCut.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTileSetCut.js","names":["_react","require","_TilesetCut","_interopRequireDefault","obj","__esModule","useTileSetCut","props","viewer","sceneId","cutToolRef","useRef","loadTileSetCut","current","layer","getLayerByKey","TilesetCut","_default","exports"],"sources":["excavation-analysis/hooks/useTileSetCut.js"],"sourcesContent":["import {useRef} from 'react';\nimport TilesetCut from \"../TilesetCut\";\n\nconst useTileSetCut = (props) => {\n const {viewer, sceneId} = props;\n\n const cutToolRef = useRef();\n\n const loadTileSetCut = () => {\n if (cutToolRef.current) {\n return cutToolRef.current;\n }\n\n if (sceneId) {\n let layer = viewer.getLayerByKey(sceneId);\n if (layer) {\n cutToolRef.current = new TilesetCut(layer);\n return cutToolRef.current;\n }\n }\n }\n\n\n return {loadTileSetCut}\n}\n\nexport default useTileSetCut;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAAuC,SAAAE,uBAAAC,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,gBAAAA,GAAA;AAEvC,IAAME,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,KAAK,EAAK;EAC7B,IAAOC,MAAM,GAAaD,KAAK,CAAxBC,MAAM;IAAEC,OAAO,GAAIF,KAAK,CAAhBE,OAAO;EAEtB,IAAMC,UAAU,GAAG,IAAAC,aAAM,EAAC,CAAC;EAE3B,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAA,EAAS;IACzB,IAAIF,UAAU,CAACG,OAAO,EAAE;MACpB,OAAOH,UAAU,CAACG,OAAO;IAC7B;IAEA,IAAIJ,OAAO,EAAE;MACT,IAAIK,KAAK,GAAGN,MAAM,CAACO,aAAa,CAACN,OAAO,CAAC;MACzC,IAAIK,KAAK,EAAE;QACPJ,UAAU,CAACG,OAAO,GAAG,IAAIG,sBAAU,CAACF,KAAK,CAAC;QAC1C,OAAOJ,UAAU,CAACG,OAAO;MAC7B;IACJ;EACJ,CAAC;EAGD,OAAO;IAACD,cAAc,EAAdA;EAAc,CAAC;AAC3B,CAAC;AAAA,IAAAK,QAAA,GAAAC,OAAA,cAEcZ,aAAa","ignoreList":[]}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _useDrawHandler = _interopRequireDefault(require("./hooks/useDrawHandler"));
10
+ var _useTerrainClipPlan = _interopRequireDefault(require("./hooks/useTerrainClipPlan"));
11
+ var _excavate_bottom_min = _interopRequireDefault(require("../assets/excavate_bottom_min.png"));
12
+ var _excavate_kuangqu = _interopRequireDefault(require("../assets/excavate_kuangqu.png"));
13
+ var _useProps2 = _interopRequireDefault(require("../use-props"));
14
+ var _useTileSetCut = _interopRequireDefault(require("./hooks/useTileSetCut"));
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
16
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
17
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
18
+ var ExcavationAnalysis = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
19
+ var _useProps = (0, _useProps2["default"])(),
20
+ map = _useProps.map;
21
+ var excavateDepth = (0, _react.useRef)(30);
22
+ var terrainClipPlan = (0, _useTerrainClipPlan["default"])({
23
+ viewer: map
24
+ });
25
+ var drawHandler = (0, _useDrawHandler["default"])({
26
+ viewer: map,
27
+ type: 'polygon'
28
+ });
29
+ var tileSetCut = (0, _useTileSetCut["default"])({
30
+ viewer: map,
31
+ sceneId: props.sceneId
32
+ });
33
+ drawHandler.on('drawEnd', function (res) {
34
+ // 再次绘制清除之前开挖分析
35
+ terrainClipPlan.clear();
36
+ var positions = res.map(function (item) {
37
+ return {
38
+ x: item.x,
39
+ y: item.y,
40
+ z: item.z
41
+ };
42
+ });
43
+ positions.pop();
44
+ // 开挖分析
45
+ terrainClipPlan.start({
46
+ height: excavateDepth.current,
47
+ splitNum: 100,
48
+ wallImg: _excavate_kuangqu["default"],
49
+ bottomImg: _excavate_bottom_min["default"],
50
+ positions: positions
51
+ });
52
+ // 移除绘制区域
53
+ drawHandler.clear();
54
+ var cutTool = tileSetCut.loadTileSetCut();
55
+ if (cutTool) {
56
+ cutTool.addRegion({
57
+ positions: positions,
58
+ id: new Date().getTime()
59
+ });
60
+ }
61
+ });
62
+ (0, _react.useImperativeHandle)(ref, function () {
63
+ return {
64
+ drawHandler: drawHandler,
65
+ terrainClipPlan: terrainClipPlan,
66
+ onDraw: onDraw,
67
+ onClear: onClear,
68
+ onChange: onChange
69
+ };
70
+ });
71
+ var onDraw = function onDraw() {
72
+ drawHandler.activate();
73
+ };
74
+ var onClear = function onClear() {
75
+ terrainClipPlan.clear();
76
+ };
77
+ var onChange = function onChange(value) {
78
+ excavateDepth.current = value;
79
+ terrainClipPlan.updateExcavateDepth(value);
80
+ };
81
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null);
82
+ });
83
+ var _default = exports["default"] = ExcavationAnalysis;
84
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_useDrawHandler","_interopRequireDefault","_useTerrainClipPlan","_excavate_bottom_min","_excavate_kuangqu","_useProps2","_useTileSetCut","obj","__esModule","_getRequireWildcardCache","e","WeakMap","r","t","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ExcavationAnalysis","forwardRef","props","ref","_useProps","useProps","map","excavateDepth","useRef","terrainClipPlan","useTerrainClipPlan","viewer","drawHandler","useDrawHandler","type","tileSetCut","useTileSetCut","sceneId","on","res","clear","positions","item","x","y","z","pop","start","height","current","splitNum","wallImg","excavate_kuangqu","bottomImg","excavate_bottom_min","cutTool","loadTileSetCut","addRegion","id","Date","getTime","useImperativeHandle","onDraw","onClear","onChange","activate","value","updateExcavateDepth","createElement","Fragment","_default","exports"],"sources":["excavation-analysis/index.js"],"sourcesContent":["import React, { useRef, useImperativeHandle, forwardRef } from 'react'\nimport useDrawHandler from './hooks/useDrawHandler'\nimport useTerrainClipPlan from './hooks/useTerrainClipPlan'\nimport excavate_bottom_min from '../assets/excavate_bottom_min.png';\nimport excavate_kuangqu from '../assets/excavate_kuangqu.png';\nimport useProps from '../use-props';\nimport useTileSetCut from \"./hooks/useTileSetCut\";\n\nconst ExcavationAnalysis = forwardRef((props, ref) => {\n const {map} = useProps();\n\n const excavateDepth = useRef(30);\n const terrainClipPlan = useTerrainClipPlan({\n viewer: map\n })\n const drawHandler = useDrawHandler({\n viewer: map,\n type: 'polygon'\n })\n\n const tileSetCut = useTileSetCut({\n viewer: map,\n sceneId: props.sceneId,\n })\n\n drawHandler.on('drawEnd', (res) => {\n // 再次绘制清除之前开挖分析\n terrainClipPlan.clear()\n\n const positions = res.map((item) => {\n return {\n x: item.x,\n y: item.y,\n z: item.z\n }\n })\n positions.pop()\n // 开挖分析\n terrainClipPlan.start({\n height: excavateDepth.current,\n splitNum: 100,\n wallImg: excavate_kuangqu,\n bottomImg: excavate_bottom_min,\n positions\n })\n // 移除绘制区域\n drawHandler.clear();\n\n let cutTool = tileSetCut.loadTileSetCut();\n if (cutTool) {\n cutTool.addRegion({\n positions : positions,\n id : new Date().getTime()\n })\n }\n })\n\n useImperativeHandle(ref, () => ({\n drawHandler,\n terrainClipPlan,\n onDraw,\n onClear,\n onChange,\n }))\n\n const onDraw = () => {\n drawHandler.activate()\n }\n\n const onClear = () => {\n terrainClipPlan.clear()\n }\n\n const onChange = (value) => {\n excavateDepth.current = value\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@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ require("./index.css");
4
+ //# sourceMappingURL=css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css.js","names":["require"],"sources":["excavation-analysis/style/index.js"],"sourcesContent":["import './index.less';\n"],"mappings":";;AAAAA,OAAA","ignoreList":[]}
File without changes
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ require("./index.less");
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["require"],"sources":["excavation-analysis/style/index.js"],"sourcesContent":["import './index.less';\n"],"mappings":";;AAAAA,OAAA","ignoreList":[]}
File without changes
@@ -101,23 +101,26 @@ var getCoordinates = function getCoordinates(geometryInfo) {
101
101
  if (geometryInfo) {
102
102
  if ((0, _lodash.isString)(geometryInfo)) {
103
103
  var _geometryInfo$split = geometryInfo.split(','),
104
- _geometryInfo$split2 = _slicedToArray(_geometryInfo$split, 2),
104
+ _geometryInfo$split2 = _slicedToArray(_geometryInfo$split, 3),
105
105
  start = _geometryInfo$split2[0],
106
- end = _geometryInfo$split2[1];
107
- return [Number(start), Number(end)];
106
+ end = _geometryInfo$split2[1],
107
+ z = _geometryInfo$split2[2];
108
+ return [Number(start), Number(end), Number(z || 0)];
108
109
  } else if ((0, _lodash.isArray)(geometryInfo)) {
109
- var _geometryInfo = _slicedToArray(geometryInfo, 2),
110
+ var _geometryInfo = _slicedToArray(geometryInfo, 3),
110
111
  _start = _geometryInfo[0],
111
- _end = _geometryInfo[1];
112
- return [Number(_start), Number(_end)];
112
+ _end = _geometryInfo[1],
113
+ _z = _geometryInfo[2];
114
+ return [Number(_start), Number(_end), Number(_z || 0)];
113
115
  } else if ((0, _lodash.isObject)(geometryInfo)) {
114
116
  if (geometryInfo.geometryInfo) {
115
117
  return getCoordinates(geometryInfo.geometryInfo);
116
118
  }
117
- var _transformGeometry$co = _slicedToArray((0, _createFeatureCollection.transformGeometry)(geometryInfo).coordinates, 2),
119
+ var _transformGeometry$co = _slicedToArray((0, _createFeatureCollection.transformGeometry)(geometryInfo).coordinates, 3),
118
120
  _start2 = _transformGeometry$co[0],
119
- _end2 = _transformGeometry$co[1];
120
- return [Number(_start2), Number(_end2)];
121
+ _end2 = _transformGeometry$co[1],
122
+ _z2 = _transformGeometry$co[2];
123
+ return [Number(_start2), Number(_end2), Number(_z2 || 0)];
121
124
  }
122
125
  }
123
126
  };