mapJK.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  1. <template>
  2. <div id="map_jk">
  3. <div id="mapDiv" ref="map">
  4. <div id="viewDiv" ref="view">
  5. <div id="menu" class="esri-widget">
  6. </div>
  7. </div>
  8. <div id="viewDiv_2D" ref="view_2D">
  9. <div id="menu" class="esri-widget">
  10. </div>
  11. </div>
  12. <div id = "overviewDiv" ref = "overview" >
  13. </div>
  14. </div>
  15. </div>
  16. </template>
  17. <script>
  18. import $ from 'jquery';
  19. import {getCurrentInstance, onMounted} from "vue";
  20. import SetMapConfig from "../units/map/SetMapConfig.js"
  21. import InitMap from "../units/map/InitMap.js";
  22. import AddBaseMapLayer from "../units/map/AddBaseMapLayer.js";
  23. import AddSingleLayer from "../units/map/AddSingleLayer.js";
  24. import WaterEffect from "../units/map/WaterEffect.js";
  25. import Measurement from "../units/map/Measurement.js";
  26. import SunshineAnalysis from "../units/map/SunshineAnalysis.js";
  27. import AddPointEvent from "../units/map/AddPointEvent.js";
  28. import SetPopupOptions from "../units/map/SetPopuopOptions";
  29. import AddScaleEvent from "../units/map/AddScaleEvent";
  30. import ViewShedAnalysisWidget from "../units/map/ViewShedAnalysis.js";
  31. import AddLightBallEvent from "../units/map/AddLightBallEvent.js";
  32. import AddThreeGridEvent from "../units/map/addThreeGridEvent.js";
  33. import LimitHeightAnalysis from "../units/map/LimitHeightAnalysis.js";
  34. import SetLocation from "../units/map/SetLocation.js";
  35. import GeometryMeshPrismEffect from "../units/map/GeometryMeshPrismEffect.js";
  36. import ReRenderingEvent from "../units/map/ReRenderingEvent.js";
  37. import PathPipeEvent from "../units/map/PathPipeEvent.js";
  38. import FlyGLTFEvent from "../units/map/FlyGLTFEvent.js";
  39. export default {
  40. name: "mapJK",
  41. setup(){
  42. const ctx = getCurrentInstance();
  43. const bus = ctx?.appContext.config.globalProperties.$bus;
  44. let MapReady = null;
  45. let m_spatialReference = null;
  46. let m_fullExtent = null;
  47. let m_initialExtent = null;
  48. let m_view;
  49. let m_map;
  50. let measureWidget = null;
  51. let sunshineWidget = null;
  52. let m_handles = [];
  53. let viewShedAnalysisWidget = null;
  54. let addLightBallEvent = null;
  55. let addThreeGridEvent = null;
  56. let limitHeightAnalysisEvent = null;
  57. let reRenderingEvent = null;
  58. let pathPipeEvent = null;
  59. let flyGLTFEvent = null;
  60. onMounted(() =>{
  61. bus.on('CreateMap',() =>{
  62. MapReady = $.Deferred();
  63. createMap();
  64. $.when((MapReady).done(()=>{
  65. //发送消息
  66. this.$bus.$emit('SendMessage',{
  67. action:"MapIsReady",
  68. data:{
  69. "message":"地图初始化完成"
  70. }
  71. })
  72. }))
  73. })
  74. //调用方法
  75. bus.on('InvokeMethod',(data) =>{
  76. invokeMethod(data);
  77. })
  78. function createMap(){
  79. let setMapConfig = new SetMapConfig({
  80. m_spatialReference,
  81. m_fullExtent,
  82. m_initialExtent,
  83. m_handles
  84. })
  85. m_spatialReference = setMapConfig.m_spatialReference;
  86. m_fullExtent = setMapConfig.m_fullExtent;
  87. m_initialExtent = setMapConfig.m_initialExtent;
  88. m_handles = setMapConfig.m_handles;
  89. let initMap = new InitMap({
  90. m_map,
  91. m_view,
  92. m_spatialReference
  93. });
  94. m_map = initMap.m_map;
  95. m_view = initMap.m_view;
  96. }
  97. function invokeMethod(data){
  98. //后续设置验证token
  99. runMethod(data);
  100. }
  101. function runMethod(data){
  102. let methodname = data.methodname;
  103. let params = data.params;
  104. if(typeof (params) != "string"&& params)
  105. params = eval(params);
  106. switch (methodname) {
  107. case "SetBackground":
  108. setBackground(params);
  109. break;
  110. case "SetLocation":
  111. setLocation(params);
  112. break;
  113. case "AddBaseMapLayer":
  114. addBaseMapLayer(params);
  115. break;
  116. case "AddSingleLayer":
  117. addSingleLayer(params);
  118. break;
  119. case "ReRendering":
  120. reRendering(params);
  121. break;
  122. case "WaterEffect":
  123. waterEffect(params);
  124. break;
  125. case "Measurement":
  126. measurement(params);
  127. break;
  128. case "SunshineAnalysis":
  129. sunshineAnalysis(params);
  130. break
  131. case "AccessFeaturesWithPointEvents":
  132. accessFeaturesWithPointEvents(params);
  133. break;
  134. case "ShowLayersWithScaleEvents":
  135. showLayersWithScaleEvents(params);
  136. break;
  137. case "ViewshedAnalysis":
  138. viewshedAnalysis(params);
  139. break;
  140. case "FeatureLayerThreeDimension":
  141. featureLayerThreeDimension(params);
  142. break;
  143. case "AddLightBall":
  144. addLightBall(params);
  145. break;
  146. case "ThreeGrid":
  147. threeGrid(params);
  148. break;
  149. case "RealPositionGrid":
  150. realPositionGrid(params);
  151. break;
  152. case "LimitHeightAnalysis":
  153. limitHeightAnalysis(params);
  154. break;
  155. case "GeometryMeshPrismEffect":
  156. geometryMeshPrismEffect(params);
  157. break;
  158. case "PathPipe":
  159. pathPipe(params);
  160. break;
  161. case "FlyGLTF":
  162. flyGLTF(params);
  163. break;
  164. }
  165. }
  166. function setBackground(params){
  167. }
  168. function setLocation(params){
  169. let setLocation = new SetLocation({
  170. view:m_view,
  171. x:params.x,
  172. y:params.y,
  173. z:params.z,
  174. heading:params.heading,
  175. tilt:params.tilt,
  176. isfly:params.isfly,
  177. });
  178. setLocation.start();
  179. }
  180. function addBaseMapLayer(params){
  181. let addBaseMapLayer = new AddBaseMapLayer({
  182. id:params.id,
  183. title:params.title,
  184. visible:params.visible,
  185. opacity:params.opacity,
  186. url:params.url,
  187. m_spatialReference,
  188. m_fullExtent,
  189. })
  190. m_view.map.basemap = addBaseMapLayer.basemap;
  191. }
  192. function addSingleLayer(params){
  193. let addSingleLayer = new AddSingleLayer({
  194. m_map,
  195. type:params.type,
  196. id:params.id,
  197. title:params.title,
  198. visible:params.visible,
  199. opacity:params.opacity,
  200. url:params.url,
  201. renderer:params.renderer,
  202. elevationInfo:params.elevationInfo
  203. })
  204. let layer = addSingleLayer.layer;
  205. m_map.add(layer);
  206. }
  207. function getSymbol(params){
  208. return {
  209. type: "mesh-3d",
  210. symbolLayers: [{
  211. type: "fill",
  212. material: {
  213. color: params.color
  214. },
  215. edges: {
  216. type: "solid",
  217. color:[255, 255, 255],
  218. }
  219. }]
  220. };
  221. }
  222. function reRendering(params){
  223. let ids_1 = [];
  224. for(let i=0;i<10000;i++){
  225. ids_1.push(i);
  226. }
  227. let ids_2 = [];
  228. for(let i=10000;i<20000;i++){
  229. ids_2.push(i);
  230. }
  231. let renderer = {
  232. type:"unique-value",
  233. defaultSymbol: getSymbol({color: [0, 255, 0,0.8]}),
  234. defaultLabel: "Other",
  235. field: "OBJECTID",
  236. uniqueValueInfos: [
  237. ]
  238. };
  239. // 每秒更新一次网格颜色
  240. setInterval(() => {
  241. renderer.uniqueValueInfos = []
  242. // 定义分组和对应的颜色
  243. const groups = {
  244. group1: {
  245. ids: ids_1, // 分组1的 ID 列表
  246. color: [Math.floor(Math.random() * 256), Math.floor(Math.random() * 256), Math.floor(Math.random() * 256), 0.8] // 红色
  247. },
  248. group2: {
  249. ids: ids_2, // 分组3的 ID 列表
  250. color: [Math.floor(Math.random() * 256), Math.floor(Math.random() * 256), Math.floor(Math.random() * 256), 0.8] // 蓝色
  251. }
  252. };
  253. // 遍历分组,动态生成渲染规则
  254. Object.keys(groups).forEach(groupKey => {
  255. const group = groups[groupKey];
  256. group.ids.forEach(id => {
  257. renderer.uniqueValueInfos.push({
  258. value: id, // 对应的 ID
  259. symbol: getSymbol(group)
  260. });
  261. });
  262. });
  263. if(reRenderingEvent == null){
  264. reRenderingEvent = new ReRenderingEvent({
  265. m_map,
  266. type:"scene",
  267. id:"WhiteMold",
  268. renderer:renderer
  269. });
  270. }
  271. reRenderingEvent.ReRendering();
  272. }, 5000);
  273. }
  274. function waterEffect(params){
  275. params.id = "waterLayer";
  276. if(params.status === "hide"){
  277. let layer = m_map.layers.find(item => item.id === params.id);
  278. m_map.remove(layer);
  279. return
  280. }
  281. if(params.status === "show"){
  282. let layer = m_map.layers.find(item => item.id === params.id);
  283. if(typeof layer === "undefined"){
  284. let waterEffect = new WaterEffect({
  285. id:params.id,
  286. url:params.url,
  287. waveDirection:params.waveDirection,
  288. waveStrength:params.waveStrength,
  289. color:params.color
  290. })
  291. layer = waterEffect.layer;
  292. m_map.add(layer);
  293. }else{
  294. m_view.environment.lighting.waterReflectionEnabled = true;
  295. const renderer = layer.renderer.clone();
  296. renderer.symbol.symbolLayers.getItemAt(0).waveDirection = params.waveDirection;
  297. renderer.symbol.symbolLayers.getItemAt(0).waveStrength = params.waveStrength;
  298. renderer.symbol.symbolLayers.getItemAt(0).color = params.color;
  299. layer.renderer = renderer;
  300. }
  301. }
  302. }
  303. function measurement(params){
  304. let status = params.status;
  305. let type = params.type;
  306. let position = params.position;
  307. if(status === "hide"){
  308. if(measureWidget !== null){
  309. m_view.ui.remove(measureWidget);
  310. measureWidget.destroy();
  311. measureWidget = null;
  312. }
  313. return
  314. }
  315. if(status === "show"){
  316. if(measureWidget === null){
  317. let measurement = new Measurement({
  318. view:m_view,
  319. type
  320. })
  321. measureWidget = measurement.widget;
  322. }
  323. m_view.ui.add(measureWidget,position);
  324. }
  325. }
  326. function sunshineAnalysis(params){
  327. let status = params.status;
  328. let position = params.position;
  329. if(status === "hide"){
  330. if(sunshineWidget !== null){
  331. m_view.ui.remove(sunshineWidget);
  332. sunshineWidget.destroy();
  333. sunshineWidget = null;
  334. }
  335. return
  336. }
  337. if(status === "show"){
  338. if(sunshineWidget === null){
  339. let sunshineAnalysis = new SunshineAnalysis({
  340. view:m_view
  341. })
  342. sunshineWidget = sunshineAnalysis.widget;
  343. }
  344. m_view.ui.add(sunshineWidget,position);
  345. }
  346. }
  347. function accessFeaturesWithPointEvents(params){
  348. let status = params.status;
  349. let mouse_handle_id = params.mouse_handle_id;
  350. let highlight_handle_id = params.highlight_handle_id;
  351. if(status === "hide"){
  352. if(m_handles.has(mouse_handle_id)){
  353. m_handles.remove(mouse_handle_id);
  354. }
  355. if(m_handles.has(highlight_handle_id)){
  356. m_handles.remove(highlight_handle_id);
  357. }
  358. return
  359. }
  360. if(status === "show"){
  361. let type = params.type;
  362. let mouseTime = params.mouse_time;
  363. let popupTitle = params.popup_title;
  364. if(m_handles.has(mouse_handle_id)){
  365. m_handles.remove(mouse_handle_id);
  366. }
  367. if(m_handles.has(highlight_handle_id)){
  368. m_handles.remove(highlight_handle_id);
  369. }
  370. let addPointEvent = new AddPointEvent({
  371. m_view,
  372. type,
  373. highlightHandleId:highlight_handle_id,
  374. mouseTime,
  375. popupTitle,
  376. callbackFunction:accessFeaturesWithPointEventsReturn
  377. });
  378. m_handles.add(addPointEvent.mouseHandle,mouse_handle_id);
  379. }
  380. }
  381. function accessFeaturesWithPointEventsReturn(screenPoint,handleId,popupTitle){
  382. if(m_handles.has(handleId)){
  383. m_handles.remove(handleId);
  384. }
  385. m_view.hitTest(screenPoint).then((response) =>{
  386. if(response.results.length > 0){
  387. let result = response.results[0];
  388. m_view.whenLayerView(result.graphic.layer).then((lyrView) =>{
  389. let highlightHandle = lyrView.highlight(result.graphic);
  390. m_handles.add(highlightHandle,handleId);
  391. })
  392. let setPopupOptions = new SetPopupOptions({
  393. title:popupTitle,
  394. location:m_view.toMap(screenPoint),
  395. content:result.graphic.attributes
  396. })
  397. m_view.popup.open(setPopupOptions.popupOptions());
  398. }
  399. })
  400. }
  401. function showLayersWithScaleEvents(params){
  402. let status = params.status;
  403. let scale_handle_id = params.scale_handle_id;
  404. if(status === "hide"){
  405. if(m_handles.has(scale_handle_id)){
  406. m_handles.remove(scale_handle_id);
  407. }
  408. return
  409. }
  410. if(status === "show"){
  411. if(m_handles.has(scale_handle_id)){
  412. m_handles.remove(scale_handle_id);
  413. }
  414. let addScaleEvent = new AddScaleEvent({
  415. m_view,
  416. callBackFunction:showLayersWithScaleEventsReturn
  417. });
  418. m_handles.add(addScaleEvent.scaleHandle,scale_handle_id);
  419. }
  420. }
  421. function getEyeExtent() {
  422. const screenWidth = m_view.width;
  423. const screenHeight = m_view.height;
  424. // 四个角的像素坐标
  425. const screenCorners = [
  426. { x: 0, y: 0 }, // 左上角
  427. { x: screenWidth, y: 0 }, // 右上角
  428. { x: screenWidth, y: screenHeight }, // 右下角
  429. { x: 0, y: screenHeight }, // 左下角
  430. ];
  431. // 将屏幕角坐标转为地图坐标
  432. const mapPoints = screenCorners.map((screenPoint) => m_view.toMap(screenPoint)).filter(p => p);
  433. // 添加 camera.position 到 mapPoints
  434. const cameraPoint = m_view.camera.position;
  435. if (mapPoints.length < 4) {
  436. if (cameraPoint) {
  437. const bufferDistance = 2000; // 2公里
  438. const spatialReference = m_view.spatialReference;
  439. const screenExtent = {
  440. xmin: cameraPoint.x - bufferDistance,
  441. ymin: cameraPoint.y - bufferDistance,
  442. xmax: cameraPoint.x + bufferDistance,
  443. ymax: cameraPoint.y + bufferDistance,
  444. spatialReference: spatialReference,
  445. };
  446. console.warn("视图范围不足4个有效点,使用摄像机位置生成的2公里范围。");
  447. console.log(screenExtent);
  448. return screenExtent;
  449. } else {
  450. console.warn("无法获取摄像机位置,请检查视图状态。");
  451. return null;
  452. }
  453. } else {
  454. try {
  455. // 获取最小和最大坐标值
  456. const xmin = Math.min(...mapPoints.map((p) => p.x));
  457. const ymin = Math.min(...mapPoints.map((p) => p.y));
  458. const xmax = Math.max(...mapPoints.map((p) => p.x));
  459. const ymax = Math.max(...mapPoints.map((p) => p.y));
  460. const screenExtent = {
  461. xmin: xmin,
  462. ymin: ymin,
  463. xmax: xmax,
  464. ymax: ymax,
  465. spatialReference: m_view.spatialReference,
  466. };
  467. console.log(screenExtent);
  468. return screenExtent;
  469. } catch (e) {
  470. console.error("获取地图范围时出错:", e);
  471. return null;
  472. }
  473. }
  474. }
  475. function showLayersWithScaleEventsReturn(scaleValue){
  476. let eyeExtent = getEyeExtent();
  477. if(!eyeExtent){
  478. return
  479. }
  480. let height = m_view.camera.position.z;
  481. console.log("height",height,"scale",m_view.scale)
  482. let size = extentGridLimit({
  483. eyeExtent,
  484. height
  485. })
  486. let layerHeight;
  487. if(size > 400){
  488. layerHeight = 400;
  489. }else{
  490. layerHeight = size;
  491. }
  492. if(addThreeGridEvent){
  493. addThreeGridEvent.extent = {minX:eyeExtent.xmin,maxX:eyeExtent.xmax,minY:eyeExtent.ymin,maxY:eyeExtent.ymax};
  494. addThreeGridEvent.height = height>1200?1200:height;
  495. addThreeGridEvent.size = size;
  496. addThreeGridEvent.layerHeight = layerHeight;
  497. addThreeGridEvent.gridEnabled = true;
  498. addThreeGridEvent.netEnabled = true;
  499. addThreeGridEvent.start();
  500. }else{
  501. addThreeGridEvent = new AddThreeGridEvent({
  502. view:m_view,
  503. extent: {minX:eyeExtent.xmin,maxX:eyeExtent.xmax,minY:eyeExtent.ymin,maxY:eyeExtent.ymax},
  504. height:height>1200?1200:height,
  505. size:size,
  506. gridEnabled : true,
  507. netEnabled : true,
  508. layerHeight:layerHeight,
  509. })
  510. addThreeGridEvent.start();
  511. }
  512. }
  513. function extentGridLimit(params){
  514. try{
  515. let size = [0.97,7.73,61.84,123.69,1850];
  516. params.eyeExtent = {
  517. xmin: params.eyeExtent.xmin < -60000?-60000:params.eyeExtent.xmin,
  518. ymin: params.eyeExtent.ymin < -60000?-60000:params.eyeExtent.ymin,
  519. xmax: params.eyeExtent.xmax > 60000?60000:params.eyeExtent.xmax,
  520. ymax: params.eyeExtent.ymax > 70000?70000:params.eyeExtent.ymax,
  521. }
  522. for(let i = 0;i<size.length;i++){
  523. let xCount = Math.floor((params.eyeExtent.xmax - params.eyeExtent.xmin) / size[i]);
  524. let yCount = Math.floor((params.eyeExtent.ymax - params.eyeExtent.ymin) / size[i]);
  525. let zCount = Math.floor(params.height / size[i]);
  526. let count = xCount * yCount * zCount;
  527. if(count < 200000){
  528. return size[i]
  529. }
  530. }
  531. }catch(e){
  532. debugger
  533. console.log("params",params)
  534. }
  535. }
  536. // function showLayersWithScaleEventsReturn(scaleValue){
  537. // let layer = m_map.layers.find(item => item.id === "WhiteMold");
  538. // if(scaleValue > 50000){
  539. // if(layer){
  540. // layer.visible = false;
  541. // }
  542. // }else{
  543. // if(layer){
  544. // layer.visible = true;
  545. // }
  546. // }
  547. // }
  548. function viewshedAnalysis(params){
  549. let status = params.status;
  550. if(status === "hide"){
  551. if(viewShedAnalysisWidget !== null){
  552. viewShedAnalysisWidget.clearAnalysis();
  553. }
  554. return
  555. }
  556. if(status === "show"){
  557. if(viewShedAnalysisWidget === null){
  558. viewShedAnalysisWidget = new ViewShedAnalysisWidget({ view:m_view });
  559. viewShedAnalysisWidget.startAnalysis();
  560. }
  561. }
  562. }
  563. function featureLayerThreeDimension(params){
  564. let status = params.status;
  565. }
  566. function addLightBall(params){
  567. let status = params.status;
  568. if(addLightBallEvent){
  569. addLightBallEvent.clear();
  570. addLightBallEvent = null;
  571. }
  572. if(status === "hide"){
  573. return
  574. }
  575. addLightBallEvent = new AddLightBallEvent({
  576. view:m_view
  577. })
  578. addLightBallEvent.start()
  579. }
  580. function threeGrid(params){
  581. let status = params.status;
  582. if(status == "hide"){
  583. if(addThreeGridEvent){
  584. addThreeGridEvent.clear();
  585. addThreeGridEvent = null;
  586. }
  587. return
  588. }
  589. let animationEnabled = false;
  590. if(params.animationEnabled){
  591. animationEnabled = params.animationEnabled;
  592. }
  593. if(addThreeGridEvent){
  594. addThreeGridEvent.height = params.height;
  595. addThreeGridEvent.size = params.size;
  596. addThreeGridEvent.layerHeight = params.layerHeight;
  597. addThreeGridEvent.animationEnabled = animationEnabled;
  598. addThreeGridEvent.gridEnabled = true;
  599. addThreeGridEvent.netEnabled = true;
  600. addThreeGridEvent.start();
  601. }else{
  602. addThreeGridEvent = new AddThreeGridEvent({
  603. view:m_view,
  604. extent : {minX:2176,maxX:6048,minY:-1024,maxY:1352},
  605. height : params.height,
  606. size : params.size,
  607. layerHeight :params.layerHeight,
  608. gridEnabled:true,
  609. netEnabled:true,
  610. animationEnabled
  611. })
  612. addThreeGridEvent.start();
  613. }
  614. }
  615. function realPositionGrid(params){
  616. let status = params.status;
  617. }
  618. function limitHeightAnalysis(params){
  619. let status = params.status;
  620. if(limitHeightAnalysisEvent){
  621. limitHeightAnalysisEvent.clear();
  622. limitHeightAnalysisEvent =null;
  623. }
  624. if(status == "hide"){
  625. return
  626. }
  627. limitHeightAnalysisEvent = new LimitHeightAnalysis({
  628. view:m_view,
  629. map:m_map,
  630. layerId:params.layerId,
  631. limitH:params.limitH,
  632. maxLimitH:params.maxLimitH,
  633. rings:params.rings,
  634. });
  635. limitHeightAnalysisEvent.start()
  636. }
  637. function geometryMeshPrismEffect(params){
  638. let status = params.status;
  639. let f_layer = m_map.layers.find(item => item.id === "geometryMeshPrismEffect");
  640. if (f_layer) {
  641. m_map.remove(f_layer);
  642. }
  643. if(status == "hide"){
  644. return
  645. }
  646. let geometryMeshPrismEffect = new GeometryMeshPrismEffect({
  647. view:m_view,
  648. m_map,
  649. items:params.items,
  650. startHeight:params.startHeight,
  651. rings:params.rings
  652. })
  653. }
  654. function pathPipe(params){
  655. let status = params.status;
  656. if(pathPipeEvent){
  657. pathPipeEvent.clear();
  658. pathPipeEvent = null;
  659. }
  660. if(status == "hide"){
  661. return
  662. }
  663. pathPipeEvent = new PathPipeEvent({
  664. view:m_view,
  665. paths:params.paths,
  666. color:params.color,
  667. pipeRadius:params.pipeRadius
  668. });
  669. pathPipeEvent.start()
  670. }
  671. function flyGLTF(params){
  672. let status = params.status;
  673. if(flyGLTFEvent){
  674. flyGLTFEvent.clear();
  675. flyGLTFEvent = null;
  676. }
  677. if(status == "hide"){
  678. return
  679. }
  680. flyGLTFEvent = new FlyGLTFEvent({
  681. view:m_view,
  682. path:params.paths,
  683. speed:0.0001
  684. })
  685. flyGLTFEvent.start();
  686. if(params.isFollow){
  687. flyGLTFEvent.followPath();
  688. }
  689. }
  690. })
  691. }
  692. }
  693. </script>
  694. <style scoped lang="scss">
  695. #map_jk,#mapDiv,#viewDiv{
  696. height: 100%;
  697. }
  698. :deep(.esri-view-surface--touch-none::after){
  699. outline: none !important;
  700. }
  701. </style>