增加注释
Showing
2 changed files
with
129 additions
and
16 deletions
1 | | 1 | /* |
2 | * @Description: | ||
3 | * @Autor: renchao | ||
4 | * @LastEditTime: 2023-05-17 10:24:24 | ||
5 | */ | ||
2 | export default { | 6 | export default { |
3 | methods:{ | 7 | methods:{ |
8 | /** | ||
9 | * @description: downloadTxt | ||
10 | * @param {*} text | ||
11 | * @param {*} fileName | ||
12 | * @author: renchao | ||
13 | */ | ||
4 | downloadTxt(text, fileName){ | 14 | downloadTxt(text, fileName){ |
5 | let element = document.createElement('a') | 15 | let element = document.createElement('a') |
6 | element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)) | 16 | element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)) |
... | @@ -8,6 +18,11 @@ export default { | ... | @@ -8,6 +18,11 @@ export default { |
8 | element.style.display = 'none' | 18 | element.style.display = 'none' |
9 | element.click() | 19 | element.click() |
10 | }, | 20 | }, |
21 | /** | ||
22 | * @description: createTextContent | ||
23 | * @param {*} jzdInfo | ||
24 | * @author: renchao | ||
25 | */ | ||
11 | createTextContent(jzdInfo){ | 26 | createTextContent(jzdInfo){ |
12 | var textContent = ""; | 27 | var textContent = ""; |
13 | for(var i = 0;i < jzdInfo.length;i++){ | 28 | for(var i = 0;i < jzdInfo.length;i++){ |
... | @@ -18,4 +33,4 @@ export default { | ... | @@ -18,4 +33,4 @@ export default { |
18 | }, | 33 | }, |
19 | 34 | ||
20 | } | 35 | } |
21 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
36 | } | ... | ... |
1 | /* | 1 | /* |
2 | * 图形相关的操作 js | 2 | * @Description: 图形相关的操作 js |
3 | * */ | 3 | * @Autor: renchao |
4 | 4 | * @LastEditTime: 2023-05-17 10:24:24 | |
5 | */ | ||
5 | import layers from '@/api/json/layers.json' | 6 | import layers from '@/api/json/layers.json' |
6 | import queryUtils from "@/utils/map/queryUtils"; | 7 | import queryUtils from "@/utils/map/queryUtils"; |
7 | import identifyUtils from '@/utils/map/IdentifyUtils' | 8 | import identifyUtils from '@/utils/map/IdentifyUtils' |
... | @@ -19,6 +20,11 @@ export default { | ... | @@ -19,6 +20,11 @@ export default { |
19 | } | 20 | } |
20 | }, | 21 | }, |
21 | methods: { | 22 | methods: { |
23 | /** | ||
24 | * @description: getLayerByName | ||
25 | * @param {*} name | ||
26 | * @author: renchao | ||
27 | */ | ||
22 | getLayerByName (name) { | 28 | getLayerByName (name) { |
23 | for (var i = 0; i < layers.length; i++) { | 29 | for (var i = 0; i < layers.length; i++) { |
24 | if (layers[i].layerName == name) { | 30 | if (layers[i].layerName == name) { |
... | @@ -27,6 +33,14 @@ export default { | ... | @@ -27,6 +33,14 @@ export default { |
27 | } | 33 | } |
28 | return null; | 34 | return null; |
29 | }, | 35 | }, |
36 | /** | ||
37 | * @description: queryGeoByBsm | ||
38 | * @param {*} name | ||
39 | * @param {*} type | ||
40 | * @param {*} callBackFunction | ||
41 | * @param {*} outSpatialReference | ||
42 | * @author: renchao | ||
43 | */ | ||
30 | queryGeoByBsm (bsm, type, callBackFunction, outSpatialReference) { | 44 | queryGeoByBsm (bsm, type, callBackFunction, outSpatialReference) { |
31 | var layer = null; | 45 | var layer = null; |
32 | if (type == 'zd') { | 46 | if (type == 'zd') { |
... | @@ -48,13 +62,23 @@ export default { | ... | @@ -48,13 +62,23 @@ export default { |
48 | } | 62 | } |
49 | }); | 63 | }); |
50 | }, | 64 | }, |
51 | //生成介质点 | 65 | /** |
66 | * @description: 生成介质点 | ||
67 | * @param {*} graphic | ||
68 | * @author: renchao | ||
69 | */ | ||
52 | craetJZPoint (graphic) { | 70 | craetJZPoint (graphic) { |
53 | var geomtry = graphic.geometry, rings = geomtry.rings[0]; | 71 | var geomtry = graphic.geometry, rings = geomtry.rings[0]; |
54 | var pointInfos = []; | 72 | var pointInfos = []; |
55 | this.getPointByRings(rings, pointInfos); | 73 | this.getPointByRings(rings, pointInfos); |
56 | return pointInfos; | 74 | return pointInfos; |
57 | }, | 75 | }, |
76 | /** | ||
77 | * @description: getPointByRings | ||
78 | * @param {*} rings | ||
79 | * @param {*} pointInfos | ||
80 | * @author: renchao | ||
81 | */ | ||
58 | getPointByRings (rings, pointInfos) { | 82 | getPointByRings (rings, pointInfos) { |
59 | for (var i = 0; i < rings.length; i++) { | 83 | for (var i = 0; i < rings.length; i++) { |
60 | var children = rings[i]; | 84 | var children = rings[i]; |
... | @@ -70,7 +94,12 @@ export default { | ... | @@ -70,7 +94,12 @@ export default { |
70 | } | 94 | } |
71 | } | 95 | } |
72 | }, | 96 | }, |
73 | //生成介质线 | 97 | /** |
98 | * @description: 生成介质线 | ||
99 | * @param {*} graphic | ||
100 | * @param {*} callBackFunction | ||
101 | * @author: renchao | ||
102 | */ | ||
74 | createJZLine (graphic, callBackFunction) { | 103 | createJZLine (graphic, callBackFunction) { |
75 | var self = this; | 104 | var self = this; |
76 | loadModules([ | 105 | loadModules([ |
... | @@ -151,7 +180,11 @@ export default { | ... | @@ -151,7 +180,11 @@ export default { |
151 | throw (err); | 180 | throw (err); |
152 | }) | 181 | }) |
153 | }, | 182 | }, |
154 | //wkt转换成arcgis | 183 | /** |
184 | * @description: wkt转换成arcgis | ||
185 | * @param {*} wkt | ||
186 | * @author: renchao | ||
187 | */ | ||
155 | parseWktToArc (wkt) { | 188 | parseWktToArc (wkt) { |
156 | var primitive = wktParse.parse(wkt); | 189 | var primitive = wktParse.parse(wkt); |
157 | /*if(primitive.type == "MultiPolygon"){ | 190 | /*if(primitive.type == "MultiPolygon"){ |
... | @@ -159,6 +192,12 @@ export default { | ... | @@ -159,6 +192,12 @@ export default { |
159 | }*/ | 192 | }*/ |
160 | return arcgisParser.convert(primitive) | 193 | return arcgisParser.convert(primitive) |
161 | }, | 194 | }, |
195 | /** | ||
196 | * @description: postionToThisGeo | ||
197 | * @param {*} bsm | ||
198 | * @param {*} type | ||
199 | * @author: renchao | ||
200 | */ | ||
162 | postionToThisGeo (bsm, type) { | 201 | postionToThisGeo (bsm, type) { |
163 | var view = maps["testMap"]; | 202 | var view = maps["testMap"]; |
164 | var layer = view.map.findLayerById("highlightLayer"); | 203 | var layer = view.map.findLayerById("highlightLayer"); |
... | @@ -173,7 +212,12 @@ export default { | ... | @@ -173,7 +212,12 @@ export default { |
173 | this.$message.success("暂无图形信息!!!"); | 212 | this.$message.success("暂无图形信息!!!"); |
174 | } | 213 | } |
175 | }, | 214 | }, |
176 | //导入空间图形是 先判断数据是否跨界 | 215 | /** |
216 | * @description: 导入空间图形是 先判断数据是否跨界 | ||
217 | * @param {*} geometry | ||
218 | * @param {*} callBacFunction | ||
219 | * @author: renchao | ||
220 | */ | ||
177 | geoJoint (geometry, callBacFunction) { | 221 | geoJoint (geometry, callBacFunction) { |
178 | var self = this; | 222 | var self = this; |
179 | loadModules([ | 223 | loadModules([ |
... | @@ -222,7 +266,15 @@ export default { | ... | @@ -222,7 +266,15 @@ export default { |
222 | throw (err); | 266 | throw (err); |
223 | }) | 267 | }) |
224 | }, | 268 | }, |
225 | //保存或者编辑属性信息 | 269 | /** |
270 | * @description: 保存或者编辑属性信息 | ||
271 | * @param {*} bsm | ||
272 | * @param {*} type | ||
273 | * @param {*} attributes | ||
274 | * @param {*} callBackFunction | ||
275 | * @param {*} ydybsm | ||
276 | * @author: renchao | ||
277 | */ | ||
226 | updAttributes (bsm, type, attributes, callBackFunction, ydybsm) { | 278 | updAttributes (bsm, type, attributes, callBackFunction, ydybsm) { |
227 | var layer = null; | 279 | var layer = null; |
228 | if (type == 'zd') { | 280 | if (type == 'zd') { |
... | @@ -252,7 +304,13 @@ export default { | ... | @@ -252,7 +304,13 @@ export default { |
252 | } | 304 | } |
253 | }); | 305 | }); |
254 | }, | 306 | }, |
255 | //叠加分析 同一个图层的叠加分析 | 307 | /** |
308 | * @description: 叠加分析 同一个图层的叠加分析 | ||
309 | * @param {*} bsm | ||
310 | * @param {*} graphic | ||
311 | * @param {*} callBacFunction | ||
312 | * @author: renchao | ||
313 | */ | ||
256 | zdOverAnalys (bsm, graphic, callBacFunction) { | 314 | zdOverAnalys (bsm, graphic, callBacFunction) { |
257 | var self = this; | 315 | var self = this; |
258 | loadModules([ | 316 | loadModules([ |
... | @@ -281,7 +339,12 @@ export default { | ... | @@ -281,7 +339,12 @@ export default { |
281 | throw (err); | 339 | throw (err); |
282 | }) | 340 | }) |
283 | }, | 341 | }, |
284 | //添加添加元素和覆盖的元素到地图上 | 342 | /** |
343 | * @description: addOverLayer | ||
344 | * @param {*} geometry | ||
345 | * @param {*} results | ||
346 | * @author: renchao | ||
347 | */ | ||
285 | addOverLayer (geometry, results) { | 348 | addOverLayer (geometry, results) { |
286 | var view = maps["testMap"]; | 349 | var view = maps["testMap"]; |
287 | loadModules([ | 350 | loadModules([ |
... | @@ -336,6 +399,10 @@ export default { | ... | @@ -336,6 +399,10 @@ export default { |
336 | 399 | ||
337 | }) | 400 | }) |
338 | }, | 401 | }, |
402 | /** | ||
403 | * @description: clearOverLayer | ||
404 | * @author: renchao | ||
405 | */ | ||
339 | clearOverLayer () { | 406 | clearOverLayer () { |
340 | var view = maps["testMap"]; | 407 | var view = maps["testMap"]; |
341 | var layer = view.map.findLayerById("overLayer"); | 408 | var layer = view.map.findLayerById("overLayer"); |
... | @@ -343,7 +410,13 @@ export default { | ... | @@ -343,7 +410,13 @@ export default { |
343 | layer.removeAll(); | 410 | layer.removeAll(); |
344 | } | 411 | } |
345 | }, | 412 | }, |
346 | //自然幢叠加分析 不能跨宗地 图层本身的叠加分析 | 413 | /** |
414 | * @description: 自然幢叠加分析 不能跨宗地 图层本身的叠加分析 | ||
415 | * @param {*} bsm | ||
416 | * @param {*} graphic | ||
417 | * @param {*} callBacFunction | ||
418 | * @author: renchao | ||
419 | */ | ||
347 | zrzOverAnalys (bsm, graphic, callBacFunction) { | 420 | zrzOverAnalys (bsm, graphic, callBacFunction) { |
348 | var self = this; | 421 | var self = this; |
349 | loadModules([ | 422 | loadModules([ |
... | @@ -396,7 +469,13 @@ export default { | ... | @@ -396,7 +469,13 @@ export default { |
396 | console.log(err); | 469 | console.log(err); |
397 | }) | 470 | }) |
398 | }, | 471 | }, |
399 | //去除重叠部分 | 472 | /** |
473 | * @description: 去除重叠部分 | ||
474 | * @param {*} inputGraphic | ||
475 | * @param {*} subGraphic | ||
476 | * @param {*} callBackFuncton | ||
477 | * @author: renchao | ||
478 | */ | ||
400 | getDifference (inputGraphic, subGraphic, callBackFuncton) { | 479 | getDifference (inputGraphic, subGraphic, callBackFuncton) { |
401 | loadModules([ | 480 | loadModules([ |
402 | "esri/geometry/Polygon", | 481 | "esri/geometry/Polygon", |
... | @@ -420,7 +499,14 @@ export default { | ... | @@ -420,7 +499,14 @@ export default { |
420 | console.log(err); | 499 | console.log(err); |
421 | }) | 500 | }) |
422 | }, | 501 | }, |
423 | //业务处理 先用query方法 查询将所有属性查询 在做空间裁剪 | 502 | /** |
503 | * @description: 业务处理 先用query方法 查询将所有属性查询 在做空间裁剪 | ||
504 | * @param {*} subGraphics | ||
505 | * @param {*} currntGraphic | ||
506 | * @param {*} callBackFunction | ||
507 | * @param {*} flag | ||
508 | * @author: renchao | ||
509 | */ | ||
424 | getResultsDif (subGraphics, currntGraphic, callBackFunction, flag) { | 510 | getResultsDif (subGraphics, currntGraphic, callBackFunction, flag) { |
425 | var self = this; | 511 | var self = this; |
426 | loadModules([ | 512 | loadModules([ |
... | @@ -459,6 +545,13 @@ export default { | ... | @@ -459,6 +545,13 @@ export default { |
459 | }) | 545 | }) |
460 | 546 | ||
461 | }, | 547 | }, |
548 | /** | ||
549 | * @description: addGeoByBsm | ||
550 | * @param {*} bsm | ||
551 | * @param {*} type | ||
552 | * @param {*} viewId | ||
553 | * @author: renchao | ||
554 | */ | ||
462 | addGeoByBsm (bsm, type, viewId) { | 555 | addGeoByBsm (bsm, type, viewId) { |
463 | var self = this; | 556 | var self = this; |
464 | var layer = null; | 557 | var layer = null; |
... | @@ -513,6 +606,11 @@ export default { | ... | @@ -513,6 +606,11 @@ export default { |
513 | }); | 606 | }); |
514 | }, | 607 | }, |
515 | //清空当前图层 | 608 | //清空当前图层 |
609 | /** | ||
610 | * @description: 清空当前图层 | ||
611 | * @param {*} viewId | ||
612 | * @author: renchao | ||
613 | */ | ||
516 | clearHighlightLayer (viewId) { | 614 | clearHighlightLayer (viewId) { |
517 | var view = maps[viewId]; | 615 | var view = maps[viewId]; |
518 | var layer = view.map.findLayerById("highlightLayer"); | 616 | var layer = view.map.findLayerById("highlightLayer"); |
... | @@ -521,4 +619,4 @@ export default { | ... | @@ -521,4 +619,4 @@ export default { |
521 | } | 619 | } |
522 | } | 620 | } |
523 | } | 621 | } |
524 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
622 | } | ... | ... |
-
Please register or sign in to post a comment