amapTow.vue 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007
  1. <!--
  2. * @Description:
  3. * @Author: wangcc
  4. * @Date: 2022-10-19 09:32:46
  5. * @LastEditors: wangcc
  6. * @LastEditTime: 2022-11-01 14:41:59
  7. * @FilePath: \castgroup_bigscreen\src\components\amapTow.vue
  8. * @Copyright: Copyright (c) 2016~2022 by wangcc, All Rights Reserved.
  9. -->
  10. <template>
  11. <div class="map-wrap">
  12. <div id="container" tabindex="0"></div>
  13. <div id="mask"></div>
  14. <div class="yun-wrap">
  15. <img class="yun yun1" src="../assets/img/云1.png" alt />
  16. </div>
  17. <div class="yun-wrap">
  18. <img class="yun yun2" src="../assets/img/云2.png" alt />
  19. </div>
  20. <div class="yun-wrap">
  21. <img class="yun yun3" src="../assets/img/云3.png" alt />
  22. </div>
  23. <el-dialog title="查看图片" :modal="false" :visible.sync="imgDialogVisible" width="40%">
  24. <img width="100%" style="height:580px" :src="dialogImageUrl" alt />
  25. </el-dialog>
  26. </div>
  27. </template>
  28. <script>
  29. import AMapLoader from '@amap/amap-jsapi-loader';
  30. import { mapMutations, mapState, mapGetters } from 'vuex';
  31. import {
  32. smallClassMap,
  33. smallClassMapFile,
  34. rightScrollData,
  35. forestSample,
  36. alarmDataApi,
  37. financeBasePlant,
  38. financeBaseDetail,
  39. farmInfo,
  40. smallClassDetail,
  41. treePlant,
  42. projectList
  43. } from '@/service/index.js';
  44. import axios from 'axios';
  45. export default {
  46. name: 'Mapview',
  47. data() {
  48. return {
  49. imgDialogVisible: false,
  50. dialogImageUrl: null,
  51. AMap: null,
  52. map: null,
  53. lngLat: [106.628201, 26.646694],
  54. adName: '贵州省',
  55. mapLevel: 'province',
  56. adcode: '贵州省',
  57. parentId: '520000',
  58. province: '',
  59. zoom: 8,
  60. districtExplorer: null,
  61. tipMarker: null,
  62. $tipMarkerContent: null,
  63. currentAreaNode: null,
  64. cityMarkerArr: [],
  65. eventMarker: null,
  66. baseMarker: null,
  67. streetMarkerArr: [],
  68. leftPage: 'forest',
  69. putPolygonData: [],
  70. //乡镇边界
  71. townPolygons: [],
  72. // 基地详情
  73. baseMarkers: [],
  74. // 小班详情
  75. smallMarkers: [],
  76. // 时间详情
  77. eventMarkers: [],
  78. // 林场
  79. treesMarkerArr: [],
  80. // 小班边界
  81. smallClassMapArr: [],
  82. // 作物
  83. economicsArr: [],
  84. // 基地定位
  85. baseMarkerArr: [],
  86. // 时间信息
  87. eventMarkersArr: [],
  88. // 样地、小班
  89. forestMarkerArr: [],
  90. // 样地号
  91. smallClassNArr: [],
  92. // 森林资源小班边界
  93. smallClassPolygonArr: [],
  94. // 林木结构小班边界
  95. treesPolygonArr: [],
  96. // 项目列表
  97. projectMarkerArr: [],
  98. treeCompMarkers: [],
  99. townPolygonArr: [],
  100. economicsArr: [],
  101. selectData: {},
  102. districtData: {},
  103. streetData: {},
  104. // 项目小班数
  105. projectSmallClassArr: []
  106. };
  107. },
  108. watch: {
  109. '$store.state.addr.parentId': {
  110. handler(val) {
  111. // 加载小班边界
  112. // this.getSmallClass();
  113. this.parentId = val;
  114. if (this.$store.state.addr.mapLevel == 'street') {
  115. this.parentId = val.substring(0, 6);
  116. if (this.map) {
  117. this.switch2AreaNode(
  118. this.parentId,
  119. this.$store.state.addr.mapLevel,
  120. this.$store.state.addr.selectCity,
  121. this.leftPage
  122. );
  123. }
  124. }
  125. if (this.$store.state.addr.mapLevel != 'street') {
  126. this.selectData = this.$store.state.addr.selectCity;
  127. this.districtData = this.$store.state.addr.selectDistrict;
  128. this.streetData = this.$store.state.addr.selectStreet;
  129. if (this.map) {
  130. this.switch2AreaNode(
  131. this.parentId,
  132. this.$store.state.addr.mapLevel,
  133. this.$store.state.addr.selectCity,
  134. this.leftPage
  135. );
  136. }
  137. if (this.townPolygons) {
  138. this.map.remove(this.townPolygons);
  139. }
  140. if (this.townPolygonArr) {
  141. this.map.remove(this.townPolygonArr);
  142. }
  143. if (
  144. this.polygon ||
  145. this.streetMarkerArr ||
  146. this.townPolygons ||
  147. this.forestMarkerArr ||
  148. this.smallClassNArr ||
  149. this.forestMarkerArr ||
  150. this.townPolygonArr ||
  151. this.smallClassPolygonArr
  152. ) {
  153. this.map.remove(this.polygon);
  154. this.map.remove(this.streetMarkerArr);
  155. this.map.remove(this.townPolygons);
  156. this.map.remove(this.forestMarkerArr);
  157. this.map.remove(this.smallClassNArr);
  158. this.map.remove(this.forestMarkerArr);
  159. this.map.remove(this.townPolygonArr);
  160. this.map.remove(this.smallClassPolygonArr);
  161. }
  162. }
  163. }
  164. },
  165. '$store.state.addr.selectStreet'(val) {
  166. if (val.label && val.value && val.areaId) {
  167. this.map.remove(this.polygon);
  168. let labelTown = val.label;
  169. this.map.setCity(labelTown);
  170. }
  171. },
  172. '$store.state.addr.page': {
  173. handler(val) {
  174. this.leftPage = val;
  175. if (!this.parentId) {
  176. this.parentId = '520000';
  177. this.$store.state.addr.parentName = '贵州省';
  178. }
  179. console.log(val);
  180. if (this.parentId) {
  181. if (this.$store.state.addr.mapLevel == 'street') {
  182. this.getSmallClass(val);
  183. }
  184. }
  185. this.mapPolygon();
  186. if (val == 'forest' || val == 'treeSpecies') {
  187. this.getProjectList();
  188. }
  189. if (val != 'forest') {
  190. this.map.remove(this.forestMarkerArr);
  191. this.map.remove(this.smallClassNArr);
  192. this.map.remove(this.smallClassPolygonArr);
  193. this.map.remove(this.projectMarkerArr);
  194. }
  195. if (val != 'treeSpecies') {
  196. this.map.remove(this.forestMarkerArr);
  197. this.map.remove(this.treesPolygonArr);
  198. this.map.remove(this.projectMarkerArr);
  199. }
  200. if (val != 'economics') {
  201. this.map.remove(this.economicsArr);
  202. this.map.remove(this.baseMarkerArr);
  203. }
  204. if (val != 'event') {
  205. this.map.remove(this.eventMarkersArr);
  206. }
  207. }
  208. },
  209. '$store.state.addr.mapLevel': {
  210. handler(val) {
  211. if (val === 'street') {
  212. this.getSmallClass();
  213. }
  214. }
  215. },
  216. '$store.state.addr.smallClassSearch': {
  217. deep: true,
  218. immediate: true,
  219. handler: function (val, oldVal) {
  220. let _this = this;
  221. if (val) {
  222. if (val.longitude && val.latitude && !val.name) {
  223. let lanLatArr = [val.longitude, val.latitude];
  224. let imgList = [];
  225. if (val.imageList.length > 0) {
  226. val.imageList.forEach((element) => {
  227. imgList.push(`<img id="markerLabel" src="${element.image}"/>`);
  228. });
  229. } else {
  230. imgList.push('暂无图片');
  231. }
  232. this.imgClick();
  233. let smallLabel =
  234. "<div class='info-details'>" +
  235. "<h5 class='marker-title'>" +
  236. val.countyName +
  237. '-' +
  238. val.smallNumber +
  239. '</h5>' +
  240. "<div class='marker-content'>" +
  241. '<div>' +
  242. '<p>小班号:' +
  243. val.smallNumber +
  244. '</p>' +
  245. '<p>样地数:' +
  246. val.sampleCount +
  247. '</p>' +
  248. '<p>小班蓄积量:' +
  249. val.smallClassStock +
  250. '(立方米)' +
  251. '</p>' +
  252. '<p>小班占地面积:' +
  253. val.landArea +
  254. '(亩)' +
  255. '</p>' +
  256. '<p>小班树种组成:' +
  257. val.treeComp +
  258. '</p>' +
  259. '<p>地类:' +
  260. val.landType +
  261. '</p>' +
  262. '<p>林地权属:' +
  263. val.landOwner +
  264. '</p>' +
  265. '<p>林木权属:' +
  266. val.forestOwner +
  267. '</p>' +
  268. '<p>林种:' +
  269. val.forestClass +
  270. '</p>' +
  271. '<p>树种结构:' +
  272. val.treeStruct +
  273. '</p>' +
  274. '</div>' +
  275. '<div>' +
  276. '<p>起源:' +
  277. val.origin +
  278. '</p>' +
  279. '<p>优势树种:' +
  280. val.superTree +
  281. '</p>' +
  282. '<p>主要灌木名称:' +
  283. val.shrubName +
  284. '</p>' +
  285. '<p>地貌:' +
  286. val.landForm +
  287. '</p>' +
  288. '<p>海拔:' +
  289. val.altitude +
  290. '</p>' +
  291. '<p>坡位:' +
  292. val.slopePosit +
  293. '</p>' +
  294. '<p>坡向:' +
  295. val.slopeDirect +
  296. '</p>' +
  297. '<p>坡形:' +
  298. val.slopeForm +
  299. '</p>' +
  300. '<p>坡度:' +
  301. val.slope +
  302. '</p>' +
  303. '<p>森林健康度:' +
  304. val.forestHealth +
  305. '</p>' +
  306. '</div>' +
  307. '</div>' +
  308. '<div class="imgList">' +
  309. "<span class='marker-span'>图片:</span>" +
  310. '<div class="marker-imgs">' +
  311. imgList +
  312. '</div>' +
  313. '</div>' +
  314. '</div>';
  315. this.smallMarker = new AMap.Marker({
  316. map: this.map,
  317. position: lanLatArr,
  318. icon: require('@/assets/img/small-marker.png'),
  319. anchor: 'bottom-center',
  320. offset: new AMap.Pixel(0, 0),
  321. zIndex: 9999
  322. });
  323. this.smallMarker.setLabel({
  324. direction: 'right',
  325. offset: new AMap.Pixel(-230, -160), //设置文本标注偏移量
  326. content: smallLabel //设置文本标注内容
  327. });
  328. this.smallMarkers.push(_this.smallMarker);
  329. } else if (val.name == false && this.smallMarker) {
  330. this.map.on('rightclick', function (e) {
  331. _this.map.remove(_this.smallMarkers);
  332. });
  333. }
  334. }
  335. }
  336. },
  337. '$store.state.addr.eventData': {
  338. deep: true,
  339. immediate: true,
  340. handler: function (val, oldVal) {
  341. let _this = this;
  342. if (val) {
  343. if (val.longitude && val.latitude && !val.name) {
  344. let lanLatArr = [val.longitude, val.latitude];
  345. let baseIcon = '';
  346. let fireIcon = require('@/assets/img/fire.png');
  347. let cutTreeIcon = require('@/assets/img/cutTree.png');
  348. let insectpestIcon = require('@/assets/img/insectpest.png');
  349. let stealIcon = require('@/assets/img/steal.png');
  350. if (val.eventType == 1) {
  351. val.eventContLabel = '火灾';
  352. baseIcon = fireIcon;
  353. } else if (val.eventType == 2) {
  354. val.eventContLabel = '砍伐';
  355. baseIcon = cutTreeIcon;
  356. } else if (val.eventType == 3) {
  357. val.eventContLabel = '病虫害';
  358. baseIcon = insectpestIcon;
  359. } else if (val.eventType == 4) {
  360. val.eventContLabel = '偷盗林木';
  361. baseIcon = stealIcon;
  362. }
  363. let treeSmallLabel =
  364. "<div class='info-small'>" +
  365. "<h5 class='marker-title'>历史事件" +
  366. '</h5>' +
  367. "<div class='marker-content'>" +
  368. '<p>事件类型:' +
  369. val.eventContLabel +
  370. '</p>' +
  371. '<p>上报时间:' +
  372. val.createTime +
  373. '</p>' +
  374. '<p>上报人:' +
  375. val.createBy +
  376. '</p>' +
  377. '<p>位置:' +
  378. val.cityName +
  379. val.countyName +
  380. val.townName +
  381. val.villageName +
  382. '</p>' +
  383. '</div>' +
  384. '</div>';
  385. this.eventMarker = new AMap.Marker({
  386. map: this.map,
  387. position: lanLatArr,
  388. icon: baseIcon,
  389. anchor: 'bottom-center',
  390. offset: new AMap.Pixel(0, 0),
  391. zIndex: 9999
  392. });
  393. this.eventMarker.setLabel({
  394. direction: 'top',
  395. offset: new AMap.Pixel(-10, 0), //设置文本标注偏移量
  396. content: treeSmallLabel //设置文本标注内容
  397. });
  398. this.eventMarkers.push(this.eventMarker);
  399. // this.map.add(this.eventMarker);
  400. } else if (val.name == false && this.eventMarker) {
  401. this.map.on('rightclick', function (e) {
  402. _this.map.remove(_this.eventMarkers);
  403. });
  404. }
  405. }
  406. }
  407. },
  408. '$store.state.addr.baseDetail': {
  409. deep: true,
  410. immediate: true,
  411. handler: function (val, oldVal) {
  412. let _this = this;
  413. if (val) {
  414. if (val.baseLongitude && val.baseLatitude && !val.name) {
  415. let lanLatArr = [val.baseLongitude, val.baseLatitude];
  416. let treeSmallLabel =
  417. "<div class='info-small'>" +
  418. "<h5 class='marker-title'>" +
  419. val.baseName +
  420. '</h5>' +
  421. "<div class='marker-content'>" +
  422. '<p>基地名称:' +
  423. val.baseName +
  424. '</p>' +
  425. '<p>种植/养殖/加工作物:' +
  426. val.cropName +
  427. '</p>' +
  428. '<p>占地面积:' +
  429. val.baseArea +
  430. '亩' +
  431. '</p>' +
  432. '<p>位置:' +
  433. val.cityName +
  434. val.countyName +
  435. val.townName +
  436. '</p>' +
  437. '</div>' +
  438. '</div>';
  439. this.baseMarker = new AMap.Marker({
  440. map: this.map,
  441. position: lanLatArr,
  442. icon: require('@/assets/img/small-marker.png'),
  443. anchor: 'bottom-center',
  444. offset: new AMap.Pixel(0, 0),
  445. zIndex: 9999
  446. });
  447. this.baseMarker.setLabel({
  448. direction: 'top',
  449. offset: new AMap.Pixel(0, 0), //设置文本标注偏移量
  450. content: treeSmallLabel //设置文本标注内容
  451. });
  452. this.baseMarkers.push(_this.baseMarker);
  453. } else if (val.name == false && _this.baseMarker) {
  454. this.map.on('rightclick', function (e) {
  455. _this.map.remove(_this.baseMarkers);
  456. });
  457. }
  458. }
  459. }
  460. },
  461. '$store.state.addr.smallClassMap': {
  462. handler(val) {
  463. console.log(val);
  464. if (val) {
  465. if (this.projectSmallClassArr) {
  466. this.map.remove(this.projectSmallClassArr);
  467. }
  468. let capitals = { animations: 'scaless' };
  469. val.forEach((element) => {
  470. let lnglat = new AMap.LngLat(element.longitude, element.latitude);
  471. var projectSmallClass = new AMap.Text({
  472. map: this.map,
  473. text: ' ',
  474. textAlign: 'center',
  475. verticalAlign: 'middle', //middle 、bottom
  476. draggable: true,
  477. cursor: 'pointer',
  478. angle: 2,
  479. style: {
  480. width: '1px',
  481. height: '1px',
  482. 'border-radius': '50%',
  483. 'border-width': 0,
  484. 'text-align': 'center',
  485. 'font-size': '12px',
  486. color: 'blue',
  487. 'background-color': 'red',
  488. // '-moz-box-shadow': '0px 0px 20px 2px '+capitals[i].color,
  489. // 'box-shadow': '0px 0px 20px 2px '+capitals[i].color,
  490. animation:
  491. capitals.animations +
  492. '1s infinite cubic-bezier(0, 0, 0.49, 1.02)'
  493. // 'animation': 'myfirst 1s infinite'
  494. },
  495. position: lnglat
  496. });
  497. this.projectSmallClassArr.push(projectSmallClass);
  498. });
  499. }
  500. }
  501. }
  502. },
  503. computed: {
  504. ...mapGetters(['vuexCityList', 'vuexDistrictList', 'vuexStreetList']),
  505. ...mapState(['selectCity', 'selectDistrict', 'selectStreet'])
  506. },
  507. created() {
  508. this.getTreePlant();
  509. },
  510. mounted() {
  511. this.initAMap();
  512. // 加载小班边界
  513. // this.getSmallClass();
  514. },
  515. methods: {
  516. ...mapMutations([
  517. 'changeSelectCity',
  518. 'changeSelectDistrict',
  519. 'changeSelectStreet',
  520. 'changeSelectAddr'
  521. ]),
  522. initAMap() {
  523. window._AMapSecurityConfig = {
  524. securityJsCode: 'e6666dfe93e7d3c6f3a5dc35cad6befb' // 密钥
  525. };
  526. let _this = this;
  527. AMapLoader.load({
  528. key: 'f79d862df9288710e3dce6591af9dff1', //设置您的key
  529. version: '2.0',
  530. plugins: [
  531. 'AMap.ToolBar',
  532. 'AMap.Driving',
  533. 'AMap.DistrictSearch',
  534. 'AMap.MapboxVectorTileLayer'
  535. ],
  536. Loca: {
  537. version: '2.0'
  538. },
  539. AMapUI: {
  540. version: '1.1',
  541. plugins: ['overlay/SimpleMarker']
  542. },
  543. features: ['road', 'bg', 'building']
  544. }).then((AMap) => {
  545. _this.AMap = AMap;
  546. _this.map = new AMap.Map('container', {
  547. viewMode: '3D',
  548. zoom: _this.zoom,
  549. center: _this.lngLat,
  550. pitch: 45,
  551. terrain: true,
  552. features: ['road', 'bg', 'building'],
  553. layers: [new AMap.TileLayer.Satellite()]
  554. });
  555. AMapUI.load(
  556. ['ui/geo/DistrictExplorer', 'ui/geo/DistrictCluster', 'lib/$'],
  557. function (DistrictExplorer, DistrictCluster, $) {
  558. window.DistrictCluster = DistrictCluster;
  559. _this.loadMapData(DistrictExplorer, $);
  560. }
  561. );
  562. _this.map.on('rightclick', function (e) {
  563. if (_this.smallMarkers.length > 0) {
  564. _this.map.remove(_this.smallMarkers);
  565. }
  566. // if (_this.treeCompMarkers.length > 0) {
  567. // _this.map.remove(_this.treeCompMarkers);
  568. // }
  569. });
  570. let wms = new AMap.TileLayer.WMTS({
  571. url: 'http://t4.tianditu.gov.cn/img_w/wmts',
  572. blend: false,
  573. tileSize: 256,
  574. params: {
  575. Layer: 'img',
  576. Version: '1.0.0',
  577. Format: 'tiles',
  578. TileMatrixSet: 'w',
  579. STYLE: 'default',
  580. tk: '064688075f565aa463866b915c378e00'
  581. }
  582. });
  583. wms.setMap(_this.map);
  584. this.map.on('mousewheel', (e) => {
  585. var zoom = this.map.getZoom(); //获取当前地图级别
  586. if (
  587. zoom > '10.5' &&
  588. zoom < '11' &&
  589. this.$store.state.addr.mapLevel == 'street'
  590. ) {
  591. if (this.districtData.value) {
  592. let districtCode = this.districtData.value.substring(0, 6);
  593. this.$store.dispatch('searchArea', {
  594. parentId: districtCode,
  595. name: this.districtData.label,
  596. mapLevel: 'district'
  597. });
  598. }
  599. }
  600. if (
  601. zoom > '9' &&
  602. zoom < '9.5' &&
  603. this.$store.state.addr.mapLevel == 'district'
  604. ) {
  605. if (this.selectData.value) {
  606. let districtCode = this.selectData.value.substring(0, 6);
  607. this.$store.dispatch('searchArea', {
  608. parentId: districtCode,
  609. name: this.selectData.label,
  610. mapLevel: 'city'
  611. });
  612. }
  613. }
  614. if (
  615. zoom > '7.6' &&
  616. zoom < '7.9' &&
  617. this.$store.state.addr.mapLevel == 'city'
  618. ) {
  619. this.$store.dispatch('searchArea', {
  620. parentId: '520000',
  621. name: '贵州省',
  622. mapLevel: 'province'
  623. });
  624. }
  625. });
  626. });
  627. },
  628. loadMapData(DistrictExplorer, $) {
  629. let that = this;
  630. //创建一个实例
  631. that.districtExplorer = window.districtExplorer = new DistrictExplorer({
  632. eventSupport: true, //打开事件支持
  633. bubble: true,
  634. map: that.map
  635. });
  636. //当前聚焦的区域
  637. this.$tipMarkerContent = $('<div class="tipMarker top"></div>');
  638. // eslint-disable-next-line no-undef
  639. this.tipMarker = new AMap.Marker({
  640. content: this.$tipMarkerContent.get(0),
  641. offset: new AMap.Pixel(0, 0),
  642. bubble: true
  643. });
  644. //监听feature的hover事件
  645. this.districtExplorer.on(
  646. 'featureMouseout featureMouseover',
  647. (e, feature) => {
  648. this.toggleHoverFeature(
  649. feature,
  650. e.type === 'featureMouseover',
  651. e.originalEvent ? e.originalEvent.lnglat : null
  652. );
  653. }
  654. );
  655. //监听鼠标在feature上滑动
  656. this.districtExplorer.on('featureMousemove', (e) => {
  657. //更新提示位置
  658. this.tipMarker.setPosition(e.originalEvent.lnglat);
  659. });
  660. let adName = that.adName; //贵州省
  661. let mapLevel = that.mapLevel;
  662. let adcode = '520000';
  663. //feature被点击
  664. this.districtExplorer.on('featureClick', (e, feature) => {
  665. const props = feature.properties;
  666. if (props.subFeatureIndex != null) {
  667. adName = props.name;
  668. adcode = props.adcode;
  669. mapLevel = props.level;
  670. // for (let item of this.forestFarmData) {
  671. // if (props.name == item.cityName || props.name == item.countyName) {
  672. mapLevel = props.level;
  673. adName = props.name;
  674. this.$store.dispatch('searchArea', {
  675. parentId: props.adcode,
  676. name: props.name,
  677. mapLevel: props.level
  678. });
  679. let valCode = props.adcode + '000000';
  680. let areaId = '';
  681. this.vuexCityList.forEach((item) => {
  682. if (valCode == item.areaCode) {
  683. areaId = item.areaId;
  684. }
  685. });
  686. this.vuexDistrictList.forEach((item) => {
  687. if (valCode == item.areaCode) {
  688. areaId = item.areaId;
  689. }
  690. });
  691. if (props.level == 'city') {
  692. this.changeSelectCity({
  693. value: valCode,
  694. label: props.name,
  695. areaId: areaId
  696. });
  697. } else if (props.level == 'district') {
  698. this.changeSelectDistrict({
  699. value: valCode,
  700. label: props.name,
  701. areaId: areaId
  702. });
  703. }
  704. if (this.projectMarkerArr) {
  705. this.map.remove(this.projectMarkerArr);
  706. }
  707. if (this.economicsArr) {
  708. this.map.remove(this.economicsArr);
  709. }
  710. if (this.baseMarkerArr) {
  711. this.map.remove(this.baseMarkerArr);
  712. }
  713. if (this.eventMarkersArr) {
  714. this.map.remove(this.eventMarkersArr);
  715. }
  716. if (this.treesMarkerArr) {
  717. this.map.remove(this.treesMarkerArr);
  718. }
  719. }
  720. // }
  721. // }
  722. });
  723. this.switch2AreaNode(adcode);
  724. // this.getProjectList();
  725. },
  726. //根据Hover状态设置相关样式
  727. toggleHoverFeature(feature, isHover, position) {
  728. if (feature.properties.subFeatureIndex != null) {
  729. this.tipMarker.setMap(isHover ? this.map : null);
  730. if (!feature) {
  731. return;
  732. }
  733. const props = feature.properties;
  734. if (isHover) {
  735. //更新提示内容
  736. this.$tipMarkerContent.html(props.name);
  737. //更新位置
  738. this.tipMarker.setPosition(position || props.center);
  739. }
  740. //更新相关多边形的样式
  741. const polys = this.districtExplorer.findFeaturePolygonsByAdcode(
  742. props.adcode
  743. );
  744. polys.forEach((elemnt) => {
  745. elemnt.setOptions({
  746. fillColor: '#0dbc79',
  747. fillOpacity: isHover ? 0.5 : 0
  748. });
  749. });
  750. }
  751. },
  752. //绘制某个区域的边界
  753. renderAreaPolygons(areaNode) {
  754. // 加载小班边界
  755. // this.getSmallClass();
  756. let _this = this;
  757. //更新地图视野
  758. if (this.$store.state.addr.mapLevel != 'street') {
  759. this.map.setBounds(areaNode.getBounds(), null, null, false);
  760. }
  761. // 加载相关标识
  762. this.mapPolygon();
  763. //清除已有的绘制内容
  764. this.districtExplorer.clearFeaturePolygons();
  765. // 清除已绘制的省市县名称
  766. this.map.remove(this.cityMarkerArr);
  767. //绘制子区域
  768. this.districtExplorer.renderSubFeatures(areaNode, () => {
  769. return {
  770. cursor: 'default',
  771. bubble: true,
  772. strokeColor: 'yellow', //线颜色
  773. strokeOpacity: 1, //线透明度
  774. strokeWeight: 2, //线宽
  775. fillOpacity: 0 //填充透明度
  776. };
  777. });
  778. //绘制父区域
  779. this.districtExplorer.renderParentFeature(areaNode, {
  780. cursor: 'default',
  781. bubble: true,
  782. strokeColor: '#00eeff', //线颜色
  783. strokeOpacity: 1, //线透明度
  784. strokeWeight: 2, //线宽
  785. fillOpacity: 0 //填充透明度
  786. });
  787. // 绘制父级蒙版
  788. let areaPolygon = areaNode.getParentFeature();
  789. let outer = [
  790. new AMap.LngLat(-360, 90, true),
  791. new AMap.LngLat(-360, -90, true),
  792. new AMap.LngLat(360, -90, true),
  793. new AMap.LngLat(360, 90, true)
  794. ];
  795. let areaPolygonArr = [];
  796. areaPolygon.geometry.coordinates.forEach((element) => {
  797. areaPolygonArr.push(element[0]);
  798. });
  799. let holes = areaPolygonArr;
  800. let pathArray = [outer];
  801. pathArray.push.apply(pathArray, holes);
  802. this.polygon = new AMap.Polygon({
  803. pathL: pathArray,
  804. map: this.map,
  805. strokeColor: '#00eeff',
  806. strokeWeight: 1,
  807. fillColor: '#0c1b05', // 遮罩背景色
  808. fillOpacity: 0.8,
  809. height: 10000
  810. });
  811. this.polygon.setPath(pathArray);
  812. if (this.leftPage == 'forest' || this.leftPage == 'treeSpecies') {
  813. this.getProjectList();
  814. }
  815. if (areaPolygon.properties.level != 'district') {
  816. // this.setMarker();
  817. } else {
  818. this.map.remove(this.treesMarkerArr);
  819. }
  820. //查询乡镇 标识
  821. if (areaPolygon.properties.level == 'district') {
  822. if (this.$store.state.addr.mapLevel != 'street') {
  823. this.getrjx(areaPolygon.properties.name);
  824. }
  825. AMap.plugin(['AMap.DistrictSearch'], function () {
  826. let district = new AMap.DistrictSearch({
  827. // 返回行政区边界坐标等具体信息
  828. extensions: 'all',
  829. // 设置查询行政区级别为 区 (district)
  830. level: areaPolygon.properties.level,
  831. // 显示下级行政区级数,1表示返回下一级行政区
  832. subdistrict: 1
  833. });
  834. let areaCode = areaPolygon.properties.name;
  835. district.search(areaCode, function (status, result) {
  836. let streetArr = result.districtList[0].districtList;
  837. for (let elementLs in streetArr) {
  838. _this.streetMarker = new AMap.Text({
  839. //c城市指示标
  840. text: streetArr[elementLs].name,
  841. zIndex: 1,
  842. map: _this.map,
  843. anchor: 'center', // 设置文本标记锚点
  844. style: {
  845. padding: '0px 6px',
  846. color: '#fff',
  847. border: 'none',
  848. fontSize: '12px',
  849. 'background-color': '#E6810C'
  850. },
  851. position: [
  852. streetArr[elementLs].center.lng,
  853. streetArr[elementLs].center.lat
  854. ]
  855. });
  856. _this.streetMarkerArr.push(_this.streetMarker);
  857. }
  858. });
  859. });
  860. }
  861. // 添加城市标识
  862. let cityArr = areaNode.getSubFeatures();
  863. if (cityArr) {
  864. for (let i = 0; i < cityArr.length; i++) {
  865. this.cityMarker = new AMap.Text({
  866. //c城市指示标
  867. text: cityArr[i].properties.name,
  868. zIndex: 1,
  869. map: this.map,
  870. anchor: 'center', // 设置文本标记锚点
  871. style: {
  872. padding: '0px 6px',
  873. color: '#fff',
  874. border: 'none',
  875. fontSize: '12px',
  876. 'background-color': '#E6810C'
  877. },
  878. position: cityArr[i].properties.centroid
  879. });
  880. this.cityMarkerArr.push(this.cityMarker);
  881. }
  882. }
  883. },
  884. //切换区域后刷新显示内容
  885. refreshAreaNode(areaNode) {
  886. this.districtExplorer.setHoverFeature(null);
  887. this.renderAreaPolygons(areaNode);
  888. },
  889. //切换区域
  890. switch2AreaNode(adcode, mapLevel, selectStreet, page, callback) {
  891. // if (
  892. // this.currentAreaNode &&
  893. // '' + this.currentAreaNode.getAdcode() === '' + adcode
  894. // ) {
  895. // return;
  896. // }
  897. this.loadAreaNode(adcode, (error, areaNode) => {
  898. if (error) {
  899. if (callback) {
  900. callback(error);
  901. }
  902. return;
  903. }
  904. this.currentAreaNode = areaNode;
  905. //设置当前使用的定位用节点
  906. this.districtExplorer.setAreaNodesForLocating([this.currentAreaNode]);
  907. this.refreshAreaNode(areaNode);
  908. if (callback) {
  909. callback(null, areaNode);
  910. }
  911. });
  912. },
  913. // 加载区域
  914. loadAreaNode(adcode, callback) {
  915. this.districtExplorer.loadAreaNode(adcode, (error, areaNode) => {
  916. if (error) {
  917. if (callback) {
  918. callback(error);
  919. }
  920. window.console.error(error);
  921. return;
  922. }
  923. if (callback) {
  924. callback(null, areaNode);
  925. }
  926. });
  927. },
  928. // 加载林场
  929. // setMarker() {
  930. // this.forestFarmData = [];
  931. // if (this.treesMarkerArr.length > 0) {
  932. // this.map.remove(this.treesMarkerArr);
  933. // }
  934. // farmInfo().then((res) => {
  935. // this.forestFarmData = res.rows;
  936. // let parentMarker = require('@/assets/img/pre-marker.png');
  937. // this.forestFarmData.forEach((item) => {
  938. // let selectCity = this.$store.state.addr.selectCity.label;
  939. // switch (this.$store.state.addr.selectCity.label) {
  940. // case '黔西南州':
  941. // selectCity = '黔西南布依族苗族自治州';
  942. // break;
  943. // case '黔东南州':
  944. // selectCity = '黔东南苗族侗族自治州';
  945. // break;
  946. // case '黔南州':
  947. // selectCity = '黔南布依族苗族自治州';
  948. // break;
  949. // }
  950. // if (this.$store.state.addr.selectCity.label) {
  951. // if (selectCity == item.cityName) {
  952. // let lngLat = [item.longitude, item.latitude];
  953. // this.treesMarker = new AMap.Marker({
  954. // map: this.map,
  955. // position: lngLat,
  956. // icon: parentMarker,
  957. // anchor: 'bottom-center',
  958. // offset: new AMap.Pixel(0, 0)
  959. // });
  960. // this.treesMarker.setLabel({
  961. // direction: 'bottom',
  962. // offset: new AMap.Pixel(0, 0), //设置文本标注偏移量
  963. // content: `<div>${item.forestName}</div>` //设置文本标注内容
  964. // });
  965. // this.treesMarkerArr.push(this.treesMarker);
  966. // }
  967. // } else {
  968. // let lngLat = [item.longitude, item.latitude];
  969. // this.treesMarker = new AMap.Marker({
  970. // map: this.map,
  971. // position: lngLat,
  972. // icon: parentMarker,
  973. // anchor: 'bottom-center',
  974. // offset: new AMap.Pixel(0, 0)
  975. // });
  976. // this.treesMarker.setLabel({
  977. // direction: 'bottom',
  978. // offset: new AMap.Pixel(0, 0), //设置文本标注偏移量
  979. // content: `<div>${item.forestName}</div>` //设置文本标注内容
  980. // });
  981. // this.treesMarkerArr.push(this.treesMarker);
  982. // }
  983. // });
  984. // });
  985. // },
  986. // 查询项目列表
  987. getProjectList() {
  988. let params = {
  989. cityId: this.$store.state.addr.selectCity.areaId,
  990. countyId: this.$store.state.addr.selectDistrict.areaId,
  991. townId: this.$store.state.addr.selectStreet.areaId
  992. };
  993. projectList(params).then((res) => {
  994. if (res.code == 200) {
  995. let infoIcon = new AMap.Icon({
  996. size: new AMap.Size(20, 25), // 图标尺寸
  997. image: require('@/assets/img/infoMarker.png'),
  998. imageSize: new AMap.Size(20, 25) // 根据所设置的大小拉伸或压缩图片
  999. });
  1000. res.rows.forEach((element) => {
  1001. if (element.longitude && element.latitude) {
  1002. let lnglat = new AMap.LngLat(element.longitude, element.latitude);
  1003. var projectMarker = new AMap.Marker({
  1004. map: this.map,
  1005. position: lnglat,
  1006. offset: new AMap.Pixel(0, -30),
  1007. icon: infoIcon,
  1008. zIndex: 999,
  1009. topWhenClick: true
  1010. });
  1011. this.projectMarkerArr.push(projectMarker);
  1012. }
  1013. });
  1014. }
  1015. });
  1016. },
  1017. // 加载乡镇边界
  1018. getrjx(cityName) {
  1019. if (cityName == '榕江县') {
  1020. axios.get('/static/rongjangintown.json').then((res) => {
  1021. this.putPolygonData = res.data.features;
  1022. this.putPolygon();
  1023. });
  1024. } else if (cityName == '清镇市') {
  1025. axios.get('/static/qingzhenzhen.json').then((res) => {
  1026. this.putPolygonData = res.data.features;
  1027. this.putPolygon();
  1028. });
  1029. }
  1030. },
  1031. putPolygon() {
  1032. let that = this;
  1033. this.putPolygonData.forEach((element) => {
  1034. this.boundaryPolygon = new AMap.Polygon({
  1035. map: that.map,
  1036. path: element.geometry.coordinates,
  1037. strokeOpacity: 1,
  1038. fillOpacity: 0,
  1039. strokeColor: 'yellow',
  1040. strokeWeight: 1,
  1041. zIndex: 999,
  1042. cursor: 'pointer'
  1043. });
  1044. that.townPolygons.push(this.boundaryPolygon);
  1045. this.boundaryPolygon.on('click', (e) => {
  1046. let centerLanLatArr = [e.lnglat.lng, e.lnglat.lat];
  1047. that.map.remove(that.townPolygons);
  1048. // that.districtExplorer.clearFeaturePolygons();
  1049. let valCode = element.properties.XIANG;
  1050. let areaId = '';
  1051. let label = element.properties.XIANG_NAME;
  1052. this.vuexStreetList.forEach((item) => {
  1053. if (valCode == item.areaCode) {
  1054. areaId = item.areaId;
  1055. }
  1056. });
  1057. this.changeSelectStreet({
  1058. value: valCode,
  1059. label: label,
  1060. areaId: areaId
  1061. });
  1062. this.changeSelectAddr('street');
  1063. this.$store.dispatch('searchArea', {
  1064. parentId: valCode,
  1065. name: label,
  1066. mapLevel: 'street'
  1067. });
  1068. let townPolygon = new AMap.Polygon({
  1069. map: that.map,
  1070. path: element.geometry.coordinates,
  1071. strokeColor: 'yellow',
  1072. strokeWeight: 3,
  1073. fillOpacity: 0
  1074. });
  1075. this.townPolygonArr.push(townPolygon);
  1076. that.map.setZoomAndCenter(14, centerLanLatArr, false, 13);
  1077. });
  1078. that.boundaryPolygon.on('rightclick', function (e) {
  1079. if (that.smallMarkers || that.baseMarkers || that.eventMarkers) {
  1080. that.map.remove(that.smallMarkers);
  1081. that.map.remove(that.baseMarkers);
  1082. that.map.remove(that.eventMarkers);
  1083. }
  1084. });
  1085. });
  1086. },
  1087. async getSmallClass() {
  1088. let that = this;
  1089. that.smallClassMapArr = [];
  1090. let params = {
  1091. // cityId: that.$store.state.addr.selectCity.areaId,
  1092. // countyId: that.$store.state.addr.selectDistrict.areaId,
  1093. townId: this.$store.state.addr.selectStreet.areaId
  1094. };
  1095. if (that.smallClassPolygonArr.length > 0) {
  1096. that.map.remove(that.smallClassPolygonArr);
  1097. }
  1098. if (that.treesPolygonArr.length > 0) {
  1099. that.map.remove(that.treesPolygonArr);
  1100. }
  1101. // let pageData = {
  1102. // pageNum: 0,
  1103. // pageSize: 25
  1104. // };
  1105. console.log(that.leftPage);
  1106. let mapLevel = that.$store.state.addr.mapLevel;
  1107. let res = await smallClassMap({ ...params });
  1108. if (res.code == 200) {
  1109. res.rows.forEach((item) => {
  1110. // if (item.smallId != null) {
  1111. // }
  1112. // this.smallClassMapArr.push(item);
  1113. if (that.leftPage === 'forest') {
  1114. this.addForestPolygon(item);
  1115. } else if (this.leftPage === 'treeSpecies') {
  1116. this.addTreeSpeciesPolygon(item);
  1117. }
  1118. });
  1119. }
  1120. console.log(res.rows);
  1121. // if (res.code == 200 && res.total > 25) {
  1122. // const total = res.total;
  1123. // const totalPage = Math.ceil(total / pageData.pageSize);
  1124. // const render = (page, mapLevel) => {
  1125. // if (page >= totalPage) return;
  1126. // requestAnimationFrame(() => {
  1127. // render(page + 1, mapLevel);
  1128. // pageData.pageNum = page;
  1129. // smallClassMap({ ...params, ...pageData }).then((response) => {
  1130. // if (response.code == 200) {
  1131. // response.rows.forEach((item) => {
  1132. // // if (item.smallId != null) {
  1133. // // }
  1134. // // this.smallClassMapArr.push(item);
  1135. // if (that.leftPage === 'forest') {
  1136. // this.addForestPolygon(item);
  1137. // } else if (this.leftPage === 'treeSpecies') {
  1138. // this.addTreeSpeciesPolygon(item);
  1139. // }
  1140. // });
  1141. // }
  1142. // });
  1143. // });
  1144. // };
  1145. // render(pageData.pageNum, mapLevel);
  1146. // } else {
  1147. // res.rows.forEach((item) => {
  1148. // if (that.leftPage === 'forest') {
  1149. // this.addForestPolygon(item);
  1150. // } else if (this.leftPage === 'treeSpecies') {
  1151. // this.addTreeSpeciesPolygon(item);
  1152. // }
  1153. // });
  1154. // }
  1155. },
  1156. mapPolygon() {
  1157. // if (this.smallClassMapArr) {
  1158. console.log(this.leftPage);
  1159. if (this.leftPage === 'forest') {
  1160. // this.addForestPolygon(this.smallClassMapArr);
  1161. if (
  1162. // this.$store.state.addr.mapLevel == 'district' ||
  1163. this.$store.state.addr.mapLevel == 'street'
  1164. ) {
  1165. this.getForestSample(this.leftPage);
  1166. }
  1167. } else if (this.leftPage === 'treeSpecies') {
  1168. // this.addTreeSpeciesPolygon();
  1169. if (
  1170. // this.$store.state.addr.mapLevel == 'district' ||
  1171. this.$store.state.addr.mapLevel == 'street'
  1172. ) {
  1173. this.getRightScrollData(this.leftPage);
  1174. }
  1175. } else if (this.leftPage === 'economics') {
  1176. this.getEconomics();
  1177. } else if (this.leftPage === 'event') {
  1178. this.getEven();
  1179. }
  1180. // }
  1181. },
  1182. addForestPolygon(item) {
  1183. let that = this;
  1184. if (item) {
  1185. // console.log(item);
  1186. // smallClassMapArr.forEach((item) => {
  1187. let polyData = JSON.parse(item.mapInfo);
  1188. for (let elementLs in polyData.features) {
  1189. let smallClassPolygon = new AMap.Polygon({
  1190. map: that.map,
  1191. path: polyData.features[elementLs].geometry.coordinates,
  1192. strokeOpacity: 1,
  1193. fillOpacity: 0,
  1194. strokeColor: 'red',
  1195. strokeWeight: 2,
  1196. zIndex: 999,
  1197. cursor: 'pointer',
  1198. fillColor: ''
  1199. });
  1200. this.smallClassPolygonArr.push(smallClassPolygon);
  1201. smallClassPolygon.on('click', (e) => {
  1202. let imgList = [];
  1203. if (item.imageList.length > 0) {
  1204. item.imageList.forEach((element) => {
  1205. imgList.push(`<img id="markerLabel" src="${element.image}"/>`);
  1206. });
  1207. } else {
  1208. imgList.push('暂无图片');
  1209. }
  1210. this.imgClick();
  1211. let smallLabel =
  1212. "<div class='info-details'>" +
  1213. "<h5 class='marker-title'>" +
  1214. item.countyName +
  1215. '-' +
  1216. item.smallNumber +
  1217. '</h5>' +
  1218. "<div class='marker-content'>" +
  1219. '<div>' +
  1220. '<p>小班号:' +
  1221. item.smallNumber +
  1222. '</p>' +
  1223. '<p>样地数:' +
  1224. item.sampleCount +
  1225. '</p>' +
  1226. '<p>小班蓄积量:' +
  1227. item.smallClassStock +
  1228. '(立方米)' +
  1229. '</p>' +
  1230. '<p>小班占地面积:' +
  1231. item.landArea +
  1232. '(亩)' +
  1233. '</p>' +
  1234. '<p>小班树种组成:' +
  1235. item.treeComp +
  1236. '</p>' +
  1237. '<p>地类:' +
  1238. item.landType +
  1239. '</p>' +
  1240. '<p>林地权属:' +
  1241. item.landOwner +
  1242. '</p>' +
  1243. '<p>林木权属:' +
  1244. item.forestOwner +
  1245. '</p>' +
  1246. '<p>林种:' +
  1247. item.forestClass +
  1248. '</p>' +
  1249. '<p>树种结构:' +
  1250. item.treeStruct +
  1251. '</p>' +
  1252. '</div>' +
  1253. '<div>' +
  1254. '<p>起源:' +
  1255. item.origin +
  1256. '</p>' +
  1257. '<p>优势树种:' +
  1258. item.superTree +
  1259. '</p>' +
  1260. '<p>主要灌木名称:' +
  1261. item.shrubName +
  1262. '</p>' +
  1263. '<p>地貌:' +
  1264. item.landForm +
  1265. '</p>' +
  1266. '<p>海拔:' +
  1267. item.altitude +
  1268. '</p>' +
  1269. '<p>坡位:' +
  1270. item.slopePosit +
  1271. '</p>' +
  1272. '<p>坡向:' +
  1273. item.slopeDirect +
  1274. '</p>' +
  1275. '<p>坡形:' +
  1276. item.slopeForm +
  1277. '</p>' +
  1278. '<p>坡度:' +
  1279. item.slope +
  1280. '</p>' +
  1281. '<p>森林健康度:' +
  1282. item.forestHealth +
  1283. '</p>' +
  1284. '</div>' +
  1285. '</div>' +
  1286. '<div class="imgList">' +
  1287. "<span class='marker-span'>图片:</span>" +
  1288. '<div class="marker-imgs">' +
  1289. imgList +
  1290. '</div>' +
  1291. '</div>' +
  1292. '</div>';
  1293. that.smallMarker = new AMap.Marker({
  1294. map: that.map,
  1295. position: lanLatArr,
  1296. icon: require('@/assets/img/small-marker.png'),
  1297. anchor: 'bottom-center',
  1298. offset: new AMap.Pixel(-5, -6)
  1299. });
  1300. that.smallMarker.setLabel({
  1301. direction: 'right',
  1302. offset: new AMap.Pixel(-230, -160), //设置文本标注偏移量
  1303. content: smallLabel //设置文本标注内容
  1304. });
  1305. // that.smallMarker.setMap(that.map);
  1306. that.smallMarkers.push(that.smallMarker);
  1307. smallClassPolygon.setOptions({
  1308. fillOpacity: 0.7,
  1309. fillColor: 'yellow'
  1310. });
  1311. });
  1312. smallClassPolygon.on('mouseout', () => {
  1313. smallClassPolygon.setOptions({
  1314. fillOpacity: 0,
  1315. fillColor: '#ccebc5'
  1316. });
  1317. });
  1318. }
  1319. if (item.longitude && item.latitude) {
  1320. var lanLatArr = [];
  1321. lanLatArr = [item.longitude, item.latitude];
  1322. if (
  1323. this.$store.state.addr.mapLevel == 'district' ||
  1324. this.$store.state.addr.mapLevel == 'street'
  1325. ) {
  1326. this.smallClassN = new AMap.Text({
  1327. map: this.map,
  1328. position: lanLatArr,
  1329. text: item.smallNumber,
  1330. anchor: 'bottom-center',
  1331. offset: new AMap.Pixel(0, 8),
  1332. style: {
  1333. 'background-color': 'transparent',
  1334. border: 'none',
  1335. color: '#05dfff',
  1336. fontSize: '12px'
  1337. }
  1338. });
  1339. this.smallClassNArr.push(this.smallClassN);
  1340. }
  1341. }
  1342. // this.map.add(that.smallClassPolygon);
  1343. // });
  1344. }
  1345. },
  1346. imgClick() {
  1347. document.getElementsByTagName('div')[0].addEventListener('click', (e) => {
  1348. if (e.target.id === 'markerLabel') {
  1349. this.imgDialogVisible = true;
  1350. this.dialogImageUrl = e.target.currentSrc;
  1351. }
  1352. });
  1353. },
  1354. // 获取样地数据
  1355. getForestSample(page) {
  1356. forestSample({
  1357. // cityId: this.$store.state.addr.selectCity.areaId,
  1358. // countyId: this.$store.state.addr.selectDistrict.areaId,
  1359. townId: this.$store.state.addr.selectStreet.areaId
  1360. }).then((res) => {
  1361. let sampleMarker = require('@/assets/img/sample-marker.png');
  1362. let iconMeta = [28, 28];
  1363. this.setMarkers(res, sampleMarker, iconMeta, page);
  1364. });
  1365. },
  1366. // 添加地图标注(样地、树种)
  1367. setMarkers(res, sampleMarker, iconMeta, page) {
  1368. let _this = this;
  1369. if (this.forestMarker) {
  1370. this.forestMarker.setMap(null);
  1371. this.forestMarker = null;
  1372. }
  1373. this.markerData = res;
  1374. let iconMarker = sampleMarker;
  1375. let iconMetaSet = iconMeta;
  1376. let sampleIcon = new AMap.Icon({
  1377. size: new AMap.Size(iconMetaSet[0], iconMetaSet[1]), // 图标尺寸
  1378. image: iconMarker,
  1379. imageSize: new AMap.Size(iconMetaSet[0], iconMetaSet[1]) // 根据所设置的大小拉伸或压缩图片
  1380. });
  1381. this.markerData.rows.forEach((item) => {
  1382. let lngLat = [item.longitude, item.latitude];
  1383. if (item.longitude && item.latitude) {
  1384. this.forestMarker = new AMap.Marker({
  1385. map: _this.map,
  1386. position: lngLat,
  1387. icon: sampleIcon,
  1388. anchor: 'bottom-center',
  1389. offset: new AMap.Pixel(0, -18)
  1390. });
  1391. if (page === 'forest') {
  1392. this.forestMarker.setLabel({
  1393. direction: 'right',
  1394. offset: new AMap.Pixel(-8, 0), //设置文本标注偏移量
  1395. content: `<div style="color:#05dfff">${item.smallNumber}-${item.sampleNumber}</div>` //设置文本标注内容
  1396. });
  1397. let clickLabel =
  1398. "<div class='info-small'>" +
  1399. "<h5 class='marker-title'>" +
  1400. item.smallNumber +
  1401. '-' +
  1402. item.sampleNumber +
  1403. '</h5>' +
  1404. "<div class='marker-content'>" +
  1405. '<p>样地号:' +
  1406. item.sampleNumber +
  1407. '</p>' +
  1408. '<p>所属小班:' +
  1409. item.smallNumber +
  1410. '</p>' +
  1411. '<p>样地蓄积:' +
  1412. item.landStock +
  1413. '</p>' +
  1414. '<p>样地株数:' +
  1415. item.landNumber +
  1416. '</p>' +
  1417. '</div>' +
  1418. '</div>';
  1419. let lastMarker = new AMap.Marker({
  1420. position: lngLat,
  1421. icon: sampleIcon,
  1422. anchor: 'bottom-center',
  1423. offset: new AMap.Pixel(0, -18)
  1424. });
  1425. lastMarker.setLabel({
  1426. zIndex: 120,
  1427. direction: 'top',
  1428. offset: new AMap.Pixel(-4, 0), //设置文本标注偏移量
  1429. content: clickLabel //设置文本标注内容
  1430. });
  1431. this.forestMarker.on('click', function (e) {
  1432. _this.map.add(lastMarker);
  1433. });
  1434. this.forestMarker.on('mouseout', function (e) {
  1435. _this.map.remove(lastMarker);
  1436. });
  1437. } else if (page === 'treeSpecies') {
  1438. this.forestMarker.setLabel({
  1439. direction: 'top',
  1440. offset: new AMap.Pixel(0, 8), //设置文本标注偏移量
  1441. content: `<div class="label-treecomp">${item.treeComp}<span class="smallH">${item.smallNumber}</span></div>` //设置文本标注内容
  1442. });
  1443. }
  1444. // this.map.add(this.forestMarker);
  1445. // forestMarker
  1446. this.forestMarkerArr.push(this.forestMarker);
  1447. }
  1448. });
  1449. },
  1450. addTreeSpeciesPolygon(item) {
  1451. let that = this;
  1452. // that.smallClassMapArr.forEach((item) => {
  1453. let polyData = JSON.parse(item.mapInfo);
  1454. for (let elementLs in polyData.features) {
  1455. let polygonColor = '';
  1456. this.treePlant.forEach((tree) => {
  1457. if (tree.plantName == item.superTree && item.superTree == '硬阔') {
  1458. polygonColor = '#00da85';
  1459. } else if (
  1460. tree.plantName == item.superTree &&
  1461. item.superTree == '软阔'
  1462. ) {
  1463. polygonColor = '#009bfd';
  1464. } else if (
  1465. tree.plantName == item.superTree &&
  1466. item.superTree == '杉木'
  1467. ) {
  1468. polygonColor = '#eca62d';
  1469. } else if (
  1470. tree.plantName == item.superTree &&
  1471. item.superTree == '马尾松'
  1472. ) {
  1473. polygonColor = '#b82dec';
  1474. }
  1475. });
  1476. let polygon = new AMap.Polygon({
  1477. map: that.map,
  1478. path: polyData.features[elementLs].geometry.coordinates,
  1479. strokeOpacity: 1,
  1480. fillOpacity: 0.6,
  1481. strokeColor: 'red',
  1482. strokeWeight: 2,
  1483. zIndex: 999,
  1484. cursor: 'pointer',
  1485. fillColor: polygonColor
  1486. });
  1487. this.treesPolygonArr.push(polygon);
  1488. if (item.longitude && item.latitude) {
  1489. var lanLatArr = [];
  1490. polygon.on('click', (e) => {
  1491. lanLatArr = [item.longitude, item.latitude];
  1492. let treeSmallLabel =
  1493. "<div class='info-small'>" +
  1494. "<h5 class='marker-title'>小班" +
  1495. item.smallNumber +
  1496. '</h5>' +
  1497. "<div class='marker-content'>" +
  1498. '<p>树种组成:' +
  1499. item.treeComp +
  1500. '</p>' +
  1501. '<p>树种结构:' +
  1502. item.treeStruct +
  1503. '</p>' +
  1504. '<p>优势树种:' +
  1505. item.superTree +
  1506. '</p>' +
  1507. '<p>优势树种平均胸径:' +
  1508. item.superTreeDbh +
  1509. '厘米' +
  1510. '</p>' +
  1511. '<p>优势树种平均高:' +
  1512. item.superTreeHigh +
  1513. '米' +
  1514. '</p>' +
  1515. '<p>位置:' +
  1516. item.countyName +
  1517. item.townName +
  1518. item.villageName +
  1519. '</p>' +
  1520. '</div>' +
  1521. '</div>';
  1522. that.smallMarker = new AMap.Marker({
  1523. map: that.map,
  1524. position: lanLatArr,
  1525. icon: require('@/assets/img/small-marker.png'),
  1526. anchor: 'bottom-center',
  1527. offset: new AMap.Pixel(0, 0)
  1528. });
  1529. that.smallMarker.setLabel({
  1530. direction: 'top',
  1531. offset: new AMap.Pixel(-10, 0), //设置文本标注偏移量
  1532. content: treeSmallLabel //设置文本标注内容
  1533. });
  1534. that.treeCompMarkers.push(that.smallMarker);
  1535. });
  1536. that.map.on('rightclick', function (e) {
  1537. if (that.treeCompMarkers.length > 0) {
  1538. that.map.remove(that.treeCompMarkers);
  1539. }
  1540. });
  1541. }
  1542. }
  1543. // });
  1544. },
  1545. // 获取小班列表
  1546. getRightScrollData(page) {
  1547. rightScrollData({
  1548. // cityId: this.$store.state.addr.selectCity.areaId,
  1549. // countyId: this.$store.state.addr.selectDistrict.areaId,
  1550. townId: this.$store.state.addr.selectStreet.areaId
  1551. }).then((res) => {
  1552. let sampleMarker = require('@/assets/img/sanjiaod.png');
  1553. let iconMeta = [16, 10];
  1554. this.setMarkers(res, sampleMarker, iconMeta, page);
  1555. });
  1556. },
  1557. // 事件信息
  1558. getEven() {
  1559. let _this = this;
  1560. alarmDataApi({
  1561. cityId: this.$store.state.addr.selectCity.areaId,
  1562. countyId: this.$store.state.addr.selectDistrict.areaId,
  1563. townId: this.$store.state.addr.selectStreet.areaId
  1564. }).then((res) => {
  1565. res.data.forEach((item) => {
  1566. let lanLatArr = [item.longitude, item.latitude];
  1567. let baseIcon = '';
  1568. let fireIcon = require('@/assets/img/fire.png');
  1569. let cutTreeIcon = require('@/assets/img/cutTree.png');
  1570. let insectpestIcon = require('@/assets/img/insectpest.png');
  1571. let stealIcon = require('@/assets/img/steal.png');
  1572. if (item.eventType == 1) {
  1573. item.eventContLabel = '火灾';
  1574. baseIcon = fireIcon;
  1575. } else if (item.eventType == 2) {
  1576. item.eventContLabel = '砍伐';
  1577. baseIcon = cutTreeIcon;
  1578. } else if (item.eventType == 3) {
  1579. item.eventContLabel = '病虫害';
  1580. baseIcon = insectpestIcon;
  1581. } else if (item.eventType == 4) {
  1582. item.eventContLabel = '偷盗林木';
  1583. baseIcon = stealIcon;
  1584. }
  1585. _this.smallMarker = new AMap.Marker({
  1586. map: _this.map,
  1587. position: lanLatArr,
  1588. icon: baseIcon,
  1589. anchor: 'bottom-center',
  1590. offset: new AMap.Pixel(0, 0),
  1591. zIndex: 999
  1592. });
  1593. _this.eventMarkersArr.push(_this.smallMarker);
  1594. _this.smallMarker.on('click', function (e) {
  1595. let treeSmallLabel =
  1596. "<div class='info-small'>" +
  1597. "<h5 class='marker-title'>最新事件" +
  1598. '</h5>' +
  1599. "<div class='marker-content'>" +
  1600. '<p>事件类型:' +
  1601. item.eventContLabel +
  1602. '</p>' +
  1603. '<p>上报时间:' +
  1604. item.createTime +
  1605. '</p>' +
  1606. '<p>上报人:' +
  1607. item.createBy +
  1608. '</p>' +
  1609. '<p>位置:' +
  1610. item.cityName +
  1611. item.countyName +
  1612. item.townName +
  1613. item.villageName +
  1614. '</p>' +
  1615. '</div>' +
  1616. '</div>';
  1617. _this.eventMarker = new AMap.Marker({
  1618. position: lanLatArr,
  1619. icon: baseIcon,
  1620. anchor: 'bottom-center',
  1621. offset: new AMap.Pixel(0, 0),
  1622. zIndex: 999
  1623. });
  1624. _this.eventMarker.setLabel({
  1625. direction: 'top',
  1626. offset: new AMap.Pixel(-10, 0), //设置文本标注偏移量
  1627. content: treeSmallLabel //设置文本标注内容
  1628. });
  1629. _this.map.add(_this.eventMarker);
  1630. });
  1631. _this.smallMarker.on('mouseout', function (e) {
  1632. if (!_this.eventMarker) {
  1633. return;
  1634. } else {
  1635. _this.map.remove(_this.eventMarker);
  1636. }
  1637. });
  1638. });
  1639. });
  1640. },
  1641. // 林业经济
  1642. getEconomics() {
  1643. let _this = this;
  1644. financeBasePlant({
  1645. cityId: this.$store.state.addr.selectCity.areaId,
  1646. countyId: this.$store.state.addr.selectDistrict.areaId
  1647. // townId: this.$store.state.addr.selectStreet.areaId
  1648. }).then((res) => {
  1649. let economicsList = [];
  1650. let baseList = [];
  1651. res.rows.forEach((element) => {
  1652. economicsList.push({
  1653. longitude: element.cateLongitude,
  1654. latitude: element.cateLatitude,
  1655. icon: element.image
  1656. });
  1657. baseList.push({
  1658. baseId: element.baseId,
  1659. baseName: element.baseName,
  1660. longitude: element.baseLongitude,
  1661. latitude: element.baseLatitude
  1662. });
  1663. });
  1664. economicsList.forEach((item) => {
  1665. let lanLatArr = [item.longitude, item.latitude];
  1666. let beeIcon = item.icon;
  1667. let iconMeta = [82, 26];
  1668. let sampleIcon = new AMap.Icon({
  1669. size: new AMap.Size(iconMeta[0], iconMeta[1]), // 图标尺寸
  1670. image: beeIcon,
  1671. imageSize: new AMap.Size(iconMeta[0], iconMeta[1]) // 根据所设置的大小拉伸或压缩图片
  1672. });
  1673. this.smallMarker = new AMap.Marker({
  1674. map: _this.map,
  1675. position: lanLatArr,
  1676. icon: sampleIcon,
  1677. anchor: 'bottom-center',
  1678. offset: new AMap.Pixel(0, 0)
  1679. });
  1680. this.economicsArr.push(this.smallMarker);
  1681. // this.smallMarker.setMap(this.map);
  1682. });
  1683. baseList.forEach((element) => {
  1684. let lanLatArr = [element.longitude, element.latitude];
  1685. let baseIcon = require('@/assets/img/postion.png');
  1686. let iconMeta = [20, 29];
  1687. let sampleIcon = new AMap.Icon({
  1688. size: new AMap.Size(iconMeta[0], iconMeta[1]), // 图标尺寸
  1689. image: baseIcon,
  1690. imageSize: new AMap.Size(iconMeta[0], iconMeta[1]) // 根据所设置的大小拉伸或压缩图片
  1691. });
  1692. this.baseMarker = new AMap.Marker({
  1693. map: this.map,
  1694. position: lanLatArr,
  1695. icon: sampleIcon,
  1696. anchor: 'bottom-center',
  1697. offset: new AMap.Pixel(0, 0)
  1698. });
  1699. this.baseMarker.setLabel({
  1700. direction: 'right',
  1701. offset: new AMap.Pixel(0, 0), //设置文本标注偏移量
  1702. content: `<div>${element.baseName}</div>` //设置文本标注内容
  1703. });
  1704. this.baseMarkerArr.push(this.baseMarker);
  1705. this.baseMarker.on('click', function (e) {
  1706. financeBaseDetail({ baseId: element.baseId }).then((res) => {
  1707. if (res.code == 200) {
  1708. let treeSmallLabel =
  1709. "<div class='info-small'>" +
  1710. "<h5 class='marker-title'>" +
  1711. res.data.baseName +
  1712. '</h5>' +
  1713. "<div class='marker-content'>" +
  1714. '<p>基地名称:' +
  1715. res.data.baseName +
  1716. '</p>' +
  1717. '<p>种植/养殖/加工作物:' +
  1718. res.data.cropName +
  1719. '</p>' +
  1720. '<p>占地面积:' +
  1721. res.data.baseArea +
  1722. '亩' +
  1723. '</p>' +
  1724. '<p>位置:' +
  1725. res.data.cityName +
  1726. res.data.countyName +
  1727. res.data.townName +
  1728. '</p>' +
  1729. '</div>' +
  1730. '</div>';
  1731. _this.baseMarker.setLabel({
  1732. direction: 'top',
  1733. offset: new AMap.Pixel(0, 0), //设置文本标注偏移量
  1734. content: treeSmallLabel //设置文本标注内容
  1735. });
  1736. }
  1737. });
  1738. });
  1739. this.baseMarker.on('mouseout', function (e) {
  1740. _this.baseMarker.setLabel({
  1741. direction: 'right',
  1742. offset: new AMap.Pixel(0, 0), //设置文本标注偏移量
  1743. content: `<div>${element.baseName}</div>` //设置文本标注内容
  1744. });
  1745. });
  1746. });
  1747. });
  1748. },
  1749. getTreePlant() {
  1750. treePlant().then((res) => {
  1751. this.treePlant = res.rows;
  1752. });
  1753. }
  1754. }
  1755. };
  1756. </script>
  1757. <style lang='scss' scoped>
  1758. #container {
  1759. width: 100%;
  1760. height: 100vh;
  1761. /deep/ .tdt-pane {
  1762. z-index: auto;
  1763. }
  1764. }
  1765. /deep/ .amap-marker-content {
  1766. .tipMarker {
  1767. color: #555;
  1768. background-color: rgba(255, 254, 239, 0.8);
  1769. border: 1px solid #7e7e7e;
  1770. padding: 2px 6px;
  1771. font-size: 12px;
  1772. white-space: nowrap;
  1773. display: inline-block;
  1774. &:before,
  1775. &:after {
  1776. content: '';
  1777. display: block;
  1778. position: absolute;
  1779. margin: auto;
  1780. width: 0;
  1781. height: 0;
  1782. border: solid transparent;
  1783. border-width: 5px 5px;
  1784. }
  1785. &.top {
  1786. transform: translate(-50%, -110%);
  1787. &:before,
  1788. &:after {
  1789. bottom: -9px;
  1790. left: 0;
  1791. right: 0;
  1792. border-top-color: rgba(255, 254, 239, 0.8);
  1793. }
  1794. &:before {
  1795. bottom: -10px;
  1796. border-top-color: #7e7e7e;
  1797. }
  1798. }
  1799. }
  1800. }
  1801. /deep/ .amap-logo,
  1802. .amap-copyright {
  1803. display: block !important;
  1804. visibility: inherit !important;
  1805. }
  1806. /deep/ .amap-icon img {
  1807. max-width: 3rem !important;
  1808. max-height: 3rem !important;
  1809. }
  1810. /deep/ .info-small {
  1811. background-image: url('../assets/img/small-label.png');
  1812. background-repeat: no-repeat;
  1813. background-size: 100% 100%;
  1814. width: 18rem;
  1815. // height: 10rem;
  1816. color: #fff;
  1817. .marker-title {
  1818. margin: 0 auto;
  1819. line-height: 30px;
  1820. }
  1821. .marker-content {
  1822. padding: 0 20px 10px 20px;
  1823. p {
  1824. text-align: left;
  1825. font-size: 12px;
  1826. margin: 0;
  1827. line-height: 28px;
  1828. }
  1829. }
  1830. }
  1831. /deep/ .info-details {
  1832. background-image: url('../assets/img/small-label.png');
  1833. background-repeat: no-repeat;
  1834. background-size: 100% 100%;
  1835. width: 26rem;
  1836. padding-bottom: 13px;
  1837. // height: 10rem;
  1838. color: #fff;
  1839. .marker-title {
  1840. margin: 0 auto;
  1841. line-height: 50px;
  1842. }
  1843. .marker-content {
  1844. display: flex;
  1845. justify-content: space-between;
  1846. padding: 0 20px 0 20px;
  1847. .marker-span {
  1848. display: block;
  1849. }
  1850. p {
  1851. text-align: left;
  1852. font-size: 12px;
  1853. margin: 0;
  1854. line-height: 18px;
  1855. }
  1856. }
  1857. .imgList {
  1858. display: block;
  1859. text-align: left;
  1860. padding: 0 20px;
  1861. .marker-span {
  1862. display: block;
  1863. }
  1864. .marker-imgs {
  1865. display: block;
  1866. line-height: 18px !important;
  1867. width: 376px;
  1868. overflow: auto;
  1869. img {
  1870. width: 40px;
  1871. height: 40px;
  1872. margin: 0 4px;
  1873. cursor: pointer;
  1874. }
  1875. }
  1876. .marker-imgs::-webkit-scrollbar {
  1877. background: transparent;
  1878. opacity: 0.6px;
  1879. width: 10px;
  1880. height: 8px;
  1881. }
  1882. .marker-imgs::-webkit-scrollbar-thumb {
  1883. background: rgba($color: #07a2eb8e, $alpha: 0.6);
  1884. border-radius: 20px;
  1885. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  1886. }
  1887. .marker-imgs::-webkit-scrollbar-track {
  1888. /*滚动条里面轨道*/
  1889. -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  1890. border-radius: 10px;
  1891. background: transparent;
  1892. }
  1893. }
  1894. }
  1895. /deep/ .amap-marker-label {
  1896. border: 0;
  1897. background-color: transparent;
  1898. }
  1899. #mask {
  1900. width: 100%;
  1901. height: 100vh;
  1902. box-shadow: inset 0px 0px 10vw 8vw rgba(0, 10, 34, 0.54);
  1903. position: fixed;
  1904. left: 0;
  1905. right: 0;
  1906. bottom: 0;
  1907. top: 0;
  1908. pointer-events: none;
  1909. }
  1910. @keyframes imageAnimation_32630606 {
  1911. 0% {
  1912. // opacity: 0;
  1913. transform: none;
  1914. }
  1915. 34% {
  1916. // opacity: 1;
  1917. transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) scaleX(1) scaleY(1)
  1918. translate3d(34vw, 0px, 0px);
  1919. }
  1920. 67% {
  1921. // opacity: 1;
  1922. transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) scaleX(1) scaleY(1)
  1923. translate3d(67vw, 0px, 0px);
  1924. }
  1925. 100% {
  1926. // opacity: 0;
  1927. transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) scaleX(1) scaleY(1)
  1928. translate3d(160vw, 0px, 0px);
  1929. }
  1930. }
  1931. .yun-wrap {
  1932. position: fixed;
  1933. left: 0;
  1934. top: 350px;
  1935. width: 100vw;
  1936. pointer-events: none;
  1937. }
  1938. .yun {
  1939. position: fixed;
  1940. left: -500px;
  1941. animation-name: imageAnimation_32630606;
  1942. animation-iteration-count: infinite;
  1943. animation-timing-function: linear;
  1944. animation-duration: 110s;
  1945. animation-delay: 0s;
  1946. -webkit-user-drag: none;
  1947. filter: none;
  1948. pointer-events: none;
  1949. }
  1950. .yun2 {
  1951. bottom: 20px;
  1952. animation-duration: 90s;
  1953. animation-delay: 10s;
  1954. }
  1955. .yun3 {
  1956. top: 100px;
  1957. animation-duration: 120s;
  1958. animation-delay: 15s;
  1959. }
  1960. /deep/ .label-treecomp {
  1961. position: relative;
  1962. background-color: #05dfff;
  1963. color: #fff;
  1964. padding: 6px 10px;
  1965. border-radius: 8px;
  1966. font-size: 14px;
  1967. text-align: center;
  1968. &::before {
  1969. position: absolute;
  1970. top: 26px;
  1971. left: 42%;
  1972. content: '';
  1973. width: 0px;
  1974. height: 0px;
  1975. border: 6px solid transparent;
  1976. border-top-color: #05dfff;
  1977. }
  1978. .smallH {
  1979. position: absolute;
  1980. top: 34px;
  1981. z-index: 99;
  1982. display: block;
  1983. color: #05dfff;
  1984. text-align: center;
  1985. font-size: 14px;
  1986. // left: 38%;
  1987. left: 0;
  1988. width: 100%;
  1989. }
  1990. }
  1991. </style>