m35_dhjb.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877
  1. //脚本对象方法
  2. function initEditorJS() {
  3. //特征点:山顶点
  4. var workPoint1Sdd = {
  5. activate: function () {
  6. JB.showPanel("山顶点");
  7. //视角定位
  8. map.centerAt({ y: 36.061395, x: 113.94298, alt: 1903, heading: 0, pitch: -57.5 });
  9. //清除所有点
  10. workPoint1Sdd.clearPoint();
  11. workPoint2Abd.clearPoint();
  12. workPoint3Pdbhd.clearPoint();
  13. workPoint4Sjd.clearPoint();
  14. workPoint5Sjpdbhd.clearPoint();
  15. workPoint6Qxbhd.clearPoint();
  16. workLine1Sjx.clearLine();
  17. workLine2Sgx.clearLine();
  18. var arrPoint = [
  19. [113.944168, 36.071057, 536.1],
  20. [113.939593, 36.072087, 510.42],
  21. [113.942957, 36.067383, 462.29],
  22. [113.949512, 36.07117, 460.67],
  23. ];
  24. this.pointLayer = createArrPoint(arrPoint); //添加点
  25. this.textLayer = createArrText(arrPoint, "山顶点"); //添加注记
  26. },
  27. //移除点
  28. clearPoint: function () {
  29. if (this.pointLayer) {
  30. this.pointLayer.destroy();
  31. delete this.pointLayer;
  32. }
  33. },
  34. disable: function () {
  35. JB.closePanel();
  36. if (this.textLayer) {
  37. this.textLayer.destroy();
  38. delete this.textLayer;
  39. }
  40. },
  41. };
  42. //特征点:鞍部点
  43. var workPoint2Abd = {
  44. activate: function () {
  45. JB.showPanel("鞍部点");
  46. //视角定位
  47. map.centerAt(
  48. {
  49. y: 36.06062,
  50. x: 113.942836,
  51. z: 1351,
  52. heading: 0,
  53. pitch: -43.5,
  54. },
  55. {
  56. complete: () => {
  57. JB.startRotatePoint();
  58. this.timeOut = setTimeout(() => {
  59. JB.stopRotatePoint();
  60. }, 6000);
  61. },
  62. }
  63. );
  64. var arrPoint = [
  65. [113.943496, 36.068508, 449.63],
  66. [113.941962, 36.071444, 481.09],
  67. [113.948862, 36.071282, 453.99],
  68. ];
  69. this.pointLayer = createArrPoint(arrPoint);
  70. this.textLayer = createArrText(arrPoint, "鞍部点"); //添加注记
  71. },
  72. //移除点
  73. clearPoint: function () {
  74. if (this.pointLayer) {
  75. this.pointLayer.destroy();
  76. delete this.pointLayer;
  77. }
  78. },
  79. disable: function () {
  80. JB.closePanel();
  81. JB.stopRotatePoint();
  82. if (this.timeOut) {
  83. clearTimeout(this.timeOut);
  84. delete this.timeOut;
  85. }
  86. if (this.textLayer) {
  87. this.textLayer.destroy();
  88. delete this.textLayer;
  89. }
  90. },
  91. };
  92. //特征点:坡度变换点
  93. var workPoint3Pdbhd = {
  94. activate: function () {
  95. JB.showPanel("坡度变换点");
  96. //视角定位
  97. map.centerAt({ y: 36.062523, x: 113.946202, z: 1343.59, heading: 353.6, pitch: -42, roll: 0 });
  98. var arrPoint = [
  99. [113.945927, 36.069593, 431.33],
  100. [113.94593, 36.073602, 427.86],
  101. [113.942159, 36.072318, 443.86],
  102. [113.940766, 36.0693, 389.26],
  103. ];
  104. this.pointLayer = createArrPoint(arrPoint);
  105. this.textLayer = createArrText(arrPoint, "坡度变换点"); //添加注记
  106. },
  107. //移除点
  108. clearPoint: function () {
  109. if (this.pointLayer) {
  110. this.pointLayer.destroy();
  111. delete this.pointLayer;
  112. }
  113. },
  114. disable: function () {
  115. JB.closePanel();
  116. if (this.textLayer) {
  117. this.textLayer.destroy();
  118. delete this.textLayer;
  119. }
  120. },
  121. };
  122. //特征点:山脚点
  123. var workPoint4Sjd = {
  124. activate: function () {
  125. JB.showPanel("山脚点");
  126. //视角定位
  127. map.centerAt({ y: 36.05423, x: 113.945328, z: 1087.7, heading: 352.4, pitch: -25.4, roll: 360 });
  128. var arrPoint = [
  129. [113.944745, 36.063709, 350.32],
  130. [113.950068, 36.066712, 363.01],
  131. [113.936588, 36.065365, 351.94],
  132. ];
  133. this.pointLayer = createArrPoint(arrPoint);
  134. this.textLayer = createArrText(arrPoint, "山脚点"); //添加注记
  135. },
  136. //移除点
  137. clearPoint: function () {
  138. if (this.pointLayer) {
  139. this.pointLayer.destroy();
  140. delete this.pointLayer;
  141. }
  142. },
  143. disable: function () {
  144. JB.closePanel();
  145. if (this.textLayer) {
  146. this.textLayer.destroy();
  147. delete this.textLayer;
  148. }
  149. },
  150. };
  151. //特征点:山脚坡度变化点
  152. var workPoint5Sjpdbhd = {
  153. activate: function () {
  154. JB.showPanel("山脚坡度变换点");
  155. //视角定位
  156. map.centerAt({ y: 36.055819, x: 113.950153, z: 696.74, heading: 334.4, pitch: -13.2, roll: 359.9 });
  157. var arrPoint = [
  158. [113.948382, 36.068049, 414.36],
  159. [113.938975, 36.06497, 395.87],
  160. [113.941956, 36.064592, 365.89],
  161. ];
  162. this.pointLayer = createArrPoint(arrPoint);
  163. this.textLayer = createArrText(arrPoint, "山脚坡度变换点"); //添加注记
  164. },
  165. //移除点
  166. clearPoint: function () {
  167. if (this.pointLayer) {
  168. this.pointLayer.destroy();
  169. delete this.pointLayer;
  170. }
  171. },
  172. disable: function () {
  173. JB.closePanel();
  174. if (this.textLayer) {
  175. this.textLayer.destroy();
  176. delete this.textLayer;
  177. }
  178. },
  179. };
  180. //特征点:倾斜变换点
  181. var workPoint6Qxbhd = {
  182. activate: function () {
  183. JB.showPanel("倾斜变换点");
  184. //视角定位
  185. map.centerAt(
  186. { y: 36.064181, x: 113.94491, z: 1139.24, heading: 352.6, pitch: -41.2, roll: 360 },
  187. {
  188. complete: function () {
  189. JB.startRotatePoint();
  190. },
  191. }
  192. );
  193. var arrPoint = [
  194. [113.941119, 36.070139, 415.86],
  195. [113.945836, 36.069939, 453.99],
  196. [113.942108, 36.072372, 443.98],
  197. [113.945918, 36.073087, 452.72],
  198. ];
  199. this.pointLayer = createArrPoint(arrPoint);
  200. this.textLayer = createArrText(arrPoint, "倾斜变换点"); //添加注记
  201. },
  202. //移除点
  203. clearPoint: function () {
  204. if (this.pointLayer) {
  205. this.pointLayer.destroy();
  206. delete this.pointLayer;
  207. }
  208. },
  209. disable: function () {
  210. JB.closePanel();
  211. if (this.textLayer) {
  212. this.textLayer.destroy();
  213. delete this.textLayer;
  214. }
  215. },
  216. };
  217. //特征线:山脊线
  218. var workLine1Sjx = {
  219. activate: function () {
  220. JB.showPanel("山脊线");
  221. map.centerAt({
  222. y: 36.05982,
  223. x: 113.943515,
  224. z: 1534.08,
  225. heading: 354.6,
  226. pitch: -46.1,
  227. roll: 0,
  228. });
  229. workPoint6Qxbhd.clearPoint();
  230. // 以防止暂停过后继续转换视角
  231. JB.stopRotatePoint();
  232. //添加线
  233. var lineArr = [
  234. {
  235. point: [
  236. [113.944168, 36.071057, 536.1],
  237. [113.943975, 36.070229, 497.2],
  238. [113.943899, 36.0693, 467.49],
  239. [113.943496, 36.068508, 449.63],
  240. ],
  241. },
  242. {
  243. point: [
  244. [113.944168, 36.071057, 536.1],
  245. [113.943383, 36.071112, 517.51],
  246. [113.94277, 36.071261, 495.99],
  247. [113.941962, 36.071444, 481.09],
  248. ],
  249. },
  250. {
  251. point: [
  252. [113.944168, 36.071057, 536.1],
  253. [113.945999, 36.071174, 506.33],
  254. [113.946798, 36.071624, 506.06],
  255. [113.948012, 36.071508, 485.02],
  256. [113.948862, 36.071282, 453.99],
  257. ],
  258. },
  259. {
  260. point: [
  261. [113.939593, 36.072087, 510.42],
  262. [113.941962, 36.071444, 481.09],
  263. ],
  264. },
  265. {
  266. point: [
  267. [113.942957, 36.067383, 462.29],
  268. [113.943496, 36.068508, 449.63],
  269. ],
  270. },
  271. {
  272. point: [
  273. [113.939593, 36.072087, 510.42],
  274. [113.93902, 36.071731, 506.14],
  275. [113.938092, 36.071371, 492.84],
  276. [113.937261, 36.07093, 493.41],
  277. [113.936637, 36.070518, 477.11],
  278. ],
  279. },
  280. {
  281. point: [
  282. [113.944168, 36.071057, 536.1],
  283. [113.944119, 36.07132, 538.46],
  284. [113.943971, 36.071771, 534.68],
  285. [113.944034, 36.072314, 524.35],
  286. [113.944123, 36.073456, 477.01],
  287. [113.944412, 36.074636, 432.25],
  288. ],
  289. },
  290. {
  291. point: [
  292. [113.939593, 36.072087, 510.42],
  293. [113.939058, 36.072637, 507.68],
  294. [113.938715, 36.073519, 506.89],
  295. [113.937723, 36.07391, 483.06],
  296. ],
  297. },
  298. ];
  299. this.clearLine();
  300. this.polyLineLayer = new mars3d.layer.GraphicLayer();
  301. map.addLayer(this.polyLineLayer);
  302. for (var i = 0; i < lineArr.length; i++) {
  303. var item = lineArr[i];
  304. let line = new mars3d.graphic.PolylineEntity({
  305. positions: item.point,
  306. style: {
  307. width: 5,
  308. clampToGround: true,
  309. material: mars3d.MaterialUtil.createMaterialProperty(mars3d.MaterialType.LineFlow, {
  310. color: Cesium.Color.YELLOW,
  311. speed: 3, //控制速度
  312. url: "img/textures/lineClr.png",
  313. }),
  314. },
  315. tooltip: "山脊线",
  316. });
  317. this.polyLineLayer.addGraphic(line);
  318. }
  319. this.timeOut = setTimeout(() => {
  320. if (this.polyLineLayer) {
  321. this.polyLineLayer.eachGraphic((graphic) => {
  322. delete graphic.style.material;
  323. graphic.setStyle({
  324. material: Cesium.Color.YELLOW,
  325. });
  326. });
  327. }
  328. }, 4000);
  329. },
  330. clearLine: function () {
  331. if (this.polyLineLayer) {
  332. this.polyLineLayer.destroy();
  333. delete this.polyLineLayer;
  334. }
  335. },
  336. disable: function () {
  337. JB.closePanel();
  338. if (this.timeOut) {
  339. clearTimeout(this.timeOut);
  340. delete this.timeOut;
  341. }
  342. if (this.polyLineLayer) {
  343. this.polyLineLayer.eachGraphic(function (graphic) {
  344. delete graphic.style.material;
  345. graphic.setStyle({
  346. material: Cesium.Color.YELLOW,
  347. });
  348. });
  349. }
  350. },
  351. };
  352. //特征线:山谷线
  353. var workLine2Sgx = {
  354. activate: function () {
  355. JB.showPanel("山谷线");
  356. map.centerAt({ y: 36.05648, x: 113.944653, z: 2092, heading: 354.4, pitch: -44.6 });
  357. //添加线
  358. var lineArr = [
  359. {
  360. point: [
  361. [113.941971, 36.073964, 403.46],
  362. [113.941941, 36.073397, 414.46],
  363. [113.942012, 36.072802, 427.98],
  364. [113.94214, 36.072218, 445.57],
  365. [113.941901, 36.071582, 482.41],
  366. [113.941634, 36.071088, 468.32],
  367. [113.941371, 36.070708, 446.86],
  368. [113.941284, 36.070435, 431.69],
  369. [113.94103, 36.069954, 408.35],
  370. [113.941016, 36.06991, 406.56],
  371. [113.940603, 36.069227, 385.57],
  372. [113.939335, 36.067923, 367.22],
  373. ],
  374. },
  375. {
  376. point: [
  377. [113.946025, 36.074151, 403.28],
  378. [113.945954, 36.073467, 433.98],
  379. [113.945871, 36.072436, 484.02],
  380. [113.94603, 36.07161, 507.66],
  381. [113.946168, 36.071048, 501.99],
  382. [113.945904, 36.070101, 468.17],
  383. [113.945797, 36.069853, 447.03],
  384. [113.946002, 36.069094, 406.59],
  385. [113.946279, 36.067475, 378.83],
  386. ],
  387. },
  388. ];
  389. this.clearLine();
  390. this.polyLineLayer = new mars3d.layer.GraphicLayer();
  391. map.addLayer(this.polyLineLayer);
  392. for (var i = 0; i < lineArr.length; i++) {
  393. var item = lineArr[i];
  394. let line = new mars3d.graphic.PolylineEntity({
  395. positions: item.point,
  396. style: {
  397. width: 5,
  398. clampToGround: true,
  399. material: mars3d.MaterialUtil.createMaterialProperty(mars3d.MaterialType.LineFlow, {
  400. color: Cesium.Color.AQUA,
  401. speed: 3, //控制速度
  402. url: "img/textures/lineClr.png",
  403. }),
  404. },
  405. tooltip: "山谷线",
  406. });
  407. this.polyLineLayer.addGraphic(line);
  408. }
  409. this.timeOut = setTimeout(() => {
  410. if (this.polyLineLayer) {
  411. this.polyLineLayer.eachGraphic((graphic) => {
  412. delete graphic.style.material;
  413. graphic.setStyle({
  414. material: new Cesium.PolylineDashMaterialProperty({
  415. color: Cesium.Color.AQUA,
  416. dashLength: 10.0,
  417. }),
  418. });
  419. });
  420. }
  421. }, 4000);
  422. },
  423. clearLine: function () {
  424. if (this.polyLineLayer) {
  425. this.polyLineLayer.destroy();
  426. delete this.polyLineLayer;
  427. }
  428. },
  429. disable: function () {
  430. JB.closePanel();
  431. if (this.timeOut) {
  432. clearTimeout(this.timeOut);
  433. delete this.timeOut;
  434. }
  435. if (this.polyLineLayer) {
  436. this.polyLineLayer.eachGraphic(function (graphic) {
  437. delete graphic.style.material;
  438. graphic.setStyle({
  439. material: new Cesium.PolylineDashMaterialProperty({
  440. color: Cesium.Color.AQUA,
  441. dashLength: 10.0,
  442. }),
  443. });
  444. });
  445. }
  446. },
  447. };
  448. //特征线:俯瞰
  449. var workLine3Fk = {
  450. activate: function () {
  451. JB.showPanel("俯瞰");
  452. map.centerAt({ y: 36.070613, x: 113.943032, z: 3059, heading: 356.6, pitch: -88.9 });
  453. },
  454. disable: function () {
  455. JB.closePanel();
  456. },
  457. };
  458. //绘制过程:计算通过点
  459. var workDgx1Point = {
  460. activate: function () {
  461. JB.showPanel(`等高线计算过程展示 <br />
  462. <ul class="contentUl">
  463. <li>完成地性线的连接工作后,即可在同一坡度的两相邻点之间内插出每整米高程的等高线通过点。</li>
  464. <li>前提:相邻点等坡度, 原理:比例内插</li>
  465. <li><img src="img/jiaoben/dgx1.jpg" style="height:150px"/></li>
  466. <li>假设ab间的坡度是均匀的,则根据a和b点间的高差为6.4m,ab线上图上的平距为48mm,由a点到22m等高线的高差为0.8m,由b点到27m等高线的高差为0.6m,则由a点到22m等高线及由b点到27m等高线的线长,x1和x2可以根据相似三角形状原理得到如下关系式</li>
  467. <li><img src="img/jiaoben/dgx2.jpg" style="height:80px;"/></li>
  468. <ul>`);
  469. map.centerAt({ y: 36.06874, x: 113.948078, z: 811.62, heading: 292.6, pitch: -39.6 });
  470. var arrPoint = [
  471. [113.944168, 36.071057, 536.1],
  472. [113.94405, 36.070572, 519.49],
  473. [113.943981, 36.070254, 498.84],
  474. [113.943944, 36.069863, 480.01],
  475. ];
  476. this.pointLayer = createArrPoint(arrPoint);
  477. var labelText = ["b", "m", "g", "f", "h"];
  478. this.pointLayer.eachGraphic((graphic, index) => {
  479. graphic.setStyle({
  480. label: {
  481. text: labelText[index] || "",
  482. color: "yellow",
  483. font_size: 30,
  484. },
  485. });
  486. });
  487. this.lineGraphic = new mars3d.graphic.PolylineEntity({
  488. positions: [
  489. [113.944168, 36.071057, 536.1],
  490. [113.94405, 36.070572, 519.49],
  491. [113.943981, 36.070254, 498.84],
  492. [113.943944, 36.069863, 480.01],
  493. ],
  494. style: {
  495. width: 5,
  496. clampToGround: true,
  497. material: mars3d.MaterialUtil.createMaterialProperty(mars3d.MaterialType.LineFlow, {
  498. color: Cesium.Color.MAGENTA,
  499. speed: 3, //控制速度
  500. url: "img/textures/lineClr.png",
  501. }),
  502. },
  503. });
  504. map.graphicLayer.addGraphic(this.lineGraphic);
  505. },
  506. disable: function () {
  507. JB.closePanel();
  508. if (this.pointLayer) {
  509. this.pointLayer.destroy();
  510. delete this.pointLayer;
  511. }
  512. if (this.lineGraphic) {
  513. this.lineGraphic.remove();
  514. delete this.lineGraphic;
  515. }
  516. },
  517. };
  518. //绘制过程:等高线绘制
  519. var workDgx2Line = {
  520. activate: function () {
  521. JB.showPanel(`等高线通过点绘制 <br /><img src="img/jiaoben/dgx3.jpg" style="width:100%;"/>`);
  522. map.centerAt({ lat: 36.069792, lng: 113.944474, alt: 1708, heading: 357, pitch: -82 });
  523. var arrPoint = [
  524. [113.946061, 36.070867, 500.37],
  525. [113.943193, 36.070854, 499.86],
  526. [113.943335, 36.072232, 500.31],
  527. [113.94469, 36.072746, 499.44],
  528. [113.946753, 36.072311, 499.98],
  529. [113.945146, 36.071556, 519.6],
  530. [113.944671, 36.072169, 519.95],
  531. [113.943607, 36.071978, 519.48],
  532. [113.94405, 36.070572, 519.49],
  533. [113.944739, 36.070756, 520.55],
  534. ];
  535. this.pointLayer = createArrPoint(arrPoint);
  536. this.polyline1 = new mars3d.graphic.PolylineEntity({
  537. positions: [
  538. [113.945146, 36.071556, 519.6],
  539. [113.945021, 36.071174, 520.26],
  540. [113.945016, 36.070846, 519.28],
  541. [113.944739, 36.070756, 520.55],
  542. [113.944624, 36.070604, 520.01],
  543. [113.944312, 36.070527, 519.49],
  544. [113.94405, 36.070572, 519.49],
  545. [113.943976, 36.070636, 520.27],
  546. [113.943861, 36.070697, 520.12],
  547. [113.943354, 36.071204, 520],
  548. [113.943607, 36.071978, 519.48],
  549. [113.943847, 36.072224, 520.7],
  550. [113.943889, 36.072331, 520.5],
  551. [113.944011, 36.072474, 520.19],
  552. [113.944671, 36.072169, 519.95],
  553. [113.94511, 36.071581, 520.05],
  554. [113.945146, 36.071556, 519.6],
  555. ],
  556. style: {
  557. width: 3,
  558. color: "#ff0000",
  559. clampToGround: true,
  560. closure: true,
  561. },
  562. });
  563. map.graphicLayer.addGraphic(this.polyline1);
  564. this.polyline2 = new mars3d.graphic.PolylineEntity({
  565. positions: [
  566. [113.946061, 36.070867, 500.37],
  567. [113.945214, 36.070585, 500.84],
  568. [113.944658, 36.070309, 500.26],
  569. [113.943981, 36.070254, 498.84],
  570. [113.943577, 36.070474, 499.95],
  571. [113.943193, 36.070854, 499.86],
  572. [113.942839, 36.071247, 498.53],
  573. [113.942921, 36.071562, 499.55],
  574. [113.943109, 36.071823, 500],
  575. [113.943335, 36.072232, 500.31],
  576. [113.94356, 36.072587, 501.02],
  577. [113.943696, 36.072889, 499.57],
  578. [113.944123, 36.073112, 496.9],
  579. [113.94469, 36.072746, 499.44],
  580. [113.944974, 36.072371, 501.42],
  581. [113.945401, 36.071963, 500.52],
  582. [113.945867, 36.071986, 500.11],
  583. [113.946358, 36.071794, 500.05],
  584. [113.946546, 36.071771, 500.47],
  585. [113.946515, 36.071902, 500.13],
  586. [113.94662, 36.072107, 499.93],
  587. [113.946618, 36.072232, 500.05],
  588. [113.946753, 36.072311, 499.98],
  589. [113.947247, 36.072043, 499.98],
  590. [113.947433, 36.071534, 499.67],
  591. [113.946848, 36.071405, 500.22],
  592. [113.946155, 36.070912, 499.86],
  593. [113.946061, 36.070867, 500.37],
  594. ],
  595. style: {
  596. width: 3,
  597. color: "#ff0000",
  598. clampToGround: true,
  599. closure: true,
  600. },
  601. });
  602. map.graphicLayer.addGraphic(this.polyline2);
  603. },
  604. disable: function () {
  605. JB.closePanel();
  606. if (this.pointLayer) {
  607. this.pointLayer.destroy();
  608. delete this.pointLayer;
  609. }
  610. if (this.polyline1) {
  611. this.polyline1.remove();
  612. delete this.polyline1;
  613. }
  614. if (this.polyline2) {
  615. this.polyline2.remove();
  616. delete this.polyline2;
  617. }
  618. },
  619. };
  620. //绘制过程:等高线结果
  621. var workDgx3End = {
  622. activate: function () {
  623. JB.showPanel("等高线结果");
  624. map.setCameraView(
  625. { y: 36.064736, x: 113.935567, z: 1276.68, heading: 52.4, pitch: -44.5, roll: 0, duration: 3 },
  626. {
  627. complete: function () {
  628. JB.startRotatePoint(new Cesium.Cartesian3.fromDegrees(113.942685, 36.07012, 461.53));
  629. },
  630. }
  631. );
  632. //清除所有点和线
  633. workPoint1Sdd.clearPoint();
  634. workPoint2Abd.clearPoint();
  635. workPoint3Pdbhd.clearPoint();
  636. workPoint4Sjd.clearPoint();
  637. workPoint5Sjpdbhd.clearPoint();
  638. workPoint6Qxbhd.clearPoint();
  639. workLine1Sjx.clearLine();
  640. workLine2Sgx.clearLine();
  641. var contourLine = new mars3d.thing.ContourLine({
  642. positions: [
  643. [113.941558, 36.078396, 370.6],
  644. [113.932244, 36.069158, 376.55],
  645. [113.942587, 36.061319, 320],
  646. [113.952388, 36.071267, 379.63],
  647. [113.941558, 36.078396, 370.6],
  648. ],
  649. spacing: 20,
  650. width: 1.5,
  651. color: Cesium.Color.RED,
  652. });
  653. map.addThing(contourLine);
  654. this.contourLine = contourLine;
  655. },
  656. disable: function () {
  657. JB.closePanel();
  658. JB.stopRotatePoint();
  659. if (this.contourLine) {
  660. map.removeThing(this.contourLine, true);
  661. this.contourLine = null;
  662. }
  663. },
  664. };
  665. //脚本配置信息(包括顺序、时间、业务对象)
  666. var data = [
  667. {
  668. text: "特征点",
  669. state: {
  670. opened: true,
  671. selected: false,
  672. },
  673. children: [
  674. {
  675. text: "山顶点",
  676. times: 6,
  677. widget: workPoint1Sdd,
  678. },
  679. {
  680. text: "鞍部点",
  681. times: 10,
  682. widget: workPoint2Abd,
  683. },
  684. {
  685. text: "坡度变换点",
  686. times: 6,
  687. widget: workPoint3Pdbhd,
  688. },
  689. {
  690. text: "山脚点",
  691. times: 6,
  692. widget: workPoint4Sjd,
  693. },
  694. {
  695. text: "山脚坡度变换点",
  696. times: 6,
  697. widget: workPoint5Sjpdbhd,
  698. },
  699. {
  700. text: "倾斜变换点",
  701. times: 6,
  702. widget: workPoint6Qxbhd,
  703. },
  704. ],
  705. },
  706. {
  707. text: "特征线",
  708. state: {
  709. opened: true,
  710. selected: false,
  711. },
  712. children: [
  713. {
  714. text: "山脊线",
  715. times: 6,
  716. widget: workLine1Sjx,
  717. },
  718. {
  719. text: "山谷线",
  720. times: 8,
  721. widget: workLine2Sgx,
  722. },
  723. {
  724. text: "俯瞰",
  725. times: 5,
  726. widget: workLine3Fk,
  727. },
  728. ],
  729. },
  730. {
  731. text: "绘制过程",
  732. state: {
  733. opened: true,
  734. selected: false,
  735. },
  736. children: [
  737. {
  738. text: "计算通过点",
  739. times: 6,
  740. widget: workDgx1Point,
  741. },
  742. {
  743. text: "等高线绘制",
  744. times: 6,
  745. widget: workDgx2Line,
  746. },
  747. {
  748. text: "等高线结果",
  749. times: 10,
  750. widget: workDgx3End,
  751. },
  752. ],
  753. },
  754. ];
  755. // eslint-disable-next-line no-undef
  756. dataWork.initData(data);
  757. }
  758. //创建点 公共方法
  759. function createArrPoint(arrPoint) {
  760. var graphicLayer = new mars3d.layer.GraphicLayer();
  761. map.addLayer(graphicLayer);
  762. for (var i = 0; i < arrPoint.length; i++) {
  763. var item = arrPoint[i];
  764. var graphic = new mars3d.graphic.PointEntity({
  765. position: item,
  766. style: {
  767. color: "#ffffff",
  768. opacity: 0.9,
  769. outline: true,
  770. outlineColor: "#ff0000",
  771. outlineWidth: 2,
  772. visibleDepth: true,
  773. clampToGround: true,
  774. pixelSize: 10,
  775. label: {
  776. text: item[2] + "",
  777. font_size: 18,
  778. font_family: "楷体",
  779. color: Cesium.Color.AZURE,
  780. outline: true,
  781. outlineColor: Cesium.Color.BLACK,
  782. outlineWidth: 2,
  783. horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
  784. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  785. pixelOffset: new Cesium.Cartesian2(-10, -10), //偏移量
  786. },
  787. },
  788. });
  789. graphicLayer.addGraphic(graphic);
  790. }
  791. return graphicLayer;
  792. }
  793. //创建文本指示 公共方法
  794. function createArrText(arrPoint, name) {
  795. var graphicLayer = new mars3d.layer.GraphicLayer();
  796. map.addLayer(graphicLayer);
  797. for (var i = 0; i < arrPoint.length; i++) {
  798. var item = arrPoint[i];
  799. //文字注记
  800. var graphic = new mars3d.graphic.DivGraphic({
  801. position: item,
  802. style: {
  803. html: `<div class="marsImgPanel1">
  804. <div class="title">${name}</div>
  805. </div >`,
  806. clampToGround: true,
  807. horizontalOrigin: Cesium.HorizontalOrigin.LEFT,
  808. verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
  809. },
  810. });
  811. graphicLayer.addGraphic(graphic);
  812. }
  813. return graphicLayer;
  814. }