mcfxkh-Web/src/views/Home/MapCtrl/mapstyle/xunchalayer.js

879 lines
23 KiB
JavaScript

import clone from "clone";
import { PicStPromise, TestPicStPromise } from "../../../../models/_/real";
import { parseGeoJSON } from "../../../../utils/tools";
import { InfoPopNames } from "../../InfoPops";
import BaseLayer from "./baselayer";
const SourceName = '巡查';
const ShapeStyle = {
id: SourceName,
type: 'symbol',
source: SourceName,
layout: {
'icon-allow-overlap': true,
'text-allow-overlap': true,
'icon-image': '巡查',
'icon-size': [
'interpolate', ['linear'], ['zoom'],
10, 0.4,
14, 0.8,
],
'text-allow-overlap': true,
'text-size': [
'interpolate', ['linear'], ['zoom'],
10, 10,
14, 14,
],
'text-font': ['Roboto Black'],
'text-field': [
'step',
['zoom'],
'',
12, ['get', 'stnm']
],
'text-anchor': 'top',
'text-offset': [0, 1],
'visibility': 'none',
},
paint: {
'text-color': '#fff'
}
};
const page1 = [
{
"stcd": "716113701",
"type": "sk",
"hasRz": true,
"stnm": "永红水库",
"adcd": "421181105000",
"wscd": null,
"importancy": 0,
"lgtd": 115.120278,
"lttd": 31.183611,
"elev": 0,
"damel": 131.99,
"dsflz": 130.56,
"fsltdz": 129.9,
"ddz": 113.5,
"zcxsw": 129.9,
"drpTm": "2025-04-11T06:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 0,
"drpState": 2,
"rz": 130.15,
"w": 0.444,
"a_fsltdz": -10.75,
"rzTm": "2025-04-11T06:00:00.000Z",
"rzWarning": 0,
"rzState": 2,
"pic": [
{
"stcd": "716113701",
"tm": "2023-11-16T11:19:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/1116/716113701/20231116191900.jpg"
},
{
"stcd": "716113701",
"tm": "2023-11-16T09:05:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/1116/716113702/20231116170500.jpg"
}
]
},
{
"stcd": "61614200",
"type": "sk",
"hasRz": true,
"stnm": "浮桥河水库",
"adcd": "421181100000",
"wscd": null,
"importancy": 0,
"lgtd": 114.875,
"lttd": 31.166667,
"elev": 0,
"damel": 71.33,
"dsflz": 68.04,
"fsltdz": 64.89,
"ddz": 51.78,
"zcxsw": 64.89,
"drpTm": "2025-06-03T02:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 16.5,
"drpState": 1,
"rz": 60.71,
"w": 162.8,
"a_fsltdz": -4.18,
"rzTm": "2025-06-03T02:00:00.000Z",
"rzWarning": 0,
"rzState": 1,
"aRz": -4.18
},
{
"stcd": "61613010",
"type": "sk",
"hasRz": true,
"stnm": "明山水库",
"adcd": "421181103000",
"wscd": null,
"importancy": 0,
"lgtd": 115.066667,
"lttd": 31.016667,
"elev": 0,
"damel": 98.7,
"dsflz": 96.07,
"fsltdz": 93,
"ddz": 78.02,
"zcxsw": 93,
"drpTm": "2025-06-03T02:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 12.5,
"drpState": 1,
"rz": 84.43,
"w": 49.5,
"a_fsltdz": -8.569999999999993,
"rzTm": "2025-06-03T02:00:00.000Z",
"rzWarning": 0,
"rzState": 1,
"aRz": -8.57
},
{
"stcd": "716112601",
"type": "sk",
"hasRz": true,
"stnm": "永丰水库",
"adcd": "421181003000",
"wscd": null,
"importancy": 0,
"lgtd": 115.057222,
"lttd": 31.110833,
"elev": 0,
"damel": 79.57,
"dsflz": 77.82,
"fsltdz": 76.96,
"ddz": 64.96,
"zcxsw": 76.96,
"drpTm": "2025-04-11T06:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 0,
"drpState": 2,
"rz": 71.88,
"w": 1.178,
"a_fsltdz": -5.079999999999998,
"rzTm": "2025-04-11T06:00:00.000Z",
"rzWarning": 0,
"rzState": 2,
"pic": [
{
"stcd": "716112601",
"tm": "2025-04-11T06:02:20.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2025/0411/716112601/20250411140220.jpg"
},
{
"stcd": "716112601",
"tm": "2025-04-11T06:04:01.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2025/0411/716112602/20250411140401.jpg"
}
],
"aRz": -5.08
},
{
"stcd": "716115401",
"type": "sk",
"hasRz": true,
"stnm": "长冲水库",
"adcd": "421181110000",
"wscd": null,
"importancy": 0,
"lgtd": 115.061389,
"lttd": 31.408611,
"elev": 0,
"damel": 21.6,
"dsflz": 20.15,
"fsltdz": 130.8,
"ddz": 0,
"zcxsw": 130.8,
"drpTm": "2024-05-17T08:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 0,
"drpState": 2,
"rz": 126.41,
"w": 0.374,
"a_fsltdz": -4.390000000000015,
"rzTm": "2024-05-17T06:00:00.000Z",
"rzWarning": 0,
"rzState": 2,
"pic": [
{
"stcd": "716115401",
"tm": "2024-05-17T08:05:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2024/0517/716115401/20240517160500.jpg"
},
{
"stcd": "716115401",
"tm": "2024-05-17T08:20:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2024/0517/716115402/20240517162000.jpg"
}
],
"aRz": -4.39
},
{
"stcd": "716115301",
"type": "sk",
"hasRz": true,
"stnm": "葡萄冲水库",
"adcd": "421181110000",
"wscd": null,
"importancy": 0,
"lgtd": 115.051389,
"lttd": 31.423333,
"elev": 0,
"damel": 15.8,
"dsflz": 14.73,
"fsltdz": 14.3,
"ddz": 9.48,
"zcxsw": 14.3,
"drpTm": "2025-04-11T05:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 0,
"drpState": 2,
"rz": 213.75,
"w": 0.04,
"a_fsltdz": 199.45,
"rzTm": "2025-04-11T05:00:00.000Z",
"rzWarning": 1,
"rzState": 2,
"pic": [
{
"stcd": "716115301",
"tm": "2023-03-12T08:02:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/716115301/20230312160200.jpg"
},
{
"stcd": "716115301",
"tm": "2023-03-12T07:11:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/716115302/20230312151100.jpg"
}
],
"aRz": 199.45
},
{
"stcd": "716115701",
"type": "sk",
"hasRz": true,
"stnm": "二五冲水库",
"adcd": "421181110000",
"wscd": null,
"importancy": 0,
"lgtd": 115.087222,
"lttd": 31.378333,
"elev": 0,
"damel": 11.2,
"dsflz": 10.07,
"fsltdz": 108.55,
"ddz": 1.5,
"zcxsw": 108.55,
"drpTm": "2025-03-22T08:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 0,
"drpState": 2,
"rz": 99.65,
"w": 0.038,
"a_fsltdz": -8.899999999999991,
"rzTm": "2025-03-22T08:00:00.000Z",
"rzWarning": 0,
"rzState": 2,
"pic": [
{
"stcd": "716115701",
"tm": "2025-03-06T23:01:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2025/0307/716115701/20250307070100.jpg"
},
{
"stcd": "716115701",
"tm": "2024-10-18T06:28:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2024/1018/716115702/20241018142800.jpg"
}
],
"aRz": -8.9
},
{
"stcd": "716115501",
"type": "sk",
"hasRz": true,
"stnm": "石鼓庙水库",
"adcd": "421181110000",
"wscd": null,
"importancy": 0,
"lgtd": 114.049444,
"lttd": 31.392222,
"elev": 0,
"damel": 106.15,
"dsflz": 104.92,
"fsltdz": 102.45,
"ddz": 6.7,
"zcxsw": 102.45,
"drpTm": "2024-11-17T04:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 0,
"drpState": 2,
"rz": 95.86,
"w": 0.073,
"a_fsltdz": -6.590000000000003,
"rzTm": "2024-08-21T01:00:00.000Z",
"rzWarning": 0,
"rzState": 2,
"pic": [
{
"stcd": "716115501",
"tm": "2023-03-12T07:04:32.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/716115501/20230312150432.jpg"
},
{
"stcd": "716115501",
"tm": "2023-03-12T07:08:39.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/716115502/20230312150839.jpg"
}
],
"aRz": -6.59
},
{
"stcd": "716115601",
"type": "sk",
"hasRz": true,
"stnm": "滚冲水库",
"adcd": "421181110000",
"wscd": null,
"importancy": 0,
"lgtd": 115.027778,
"lttd": 31.386944,
"elev": 0,
"damel": 129.72,
"dsflz": 129.17,
"fsltdz": 128.3,
"ddz": 123,
"zcxsw": 128.3,
"drpTm": "2025-04-11T04:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 0,
"drpState": 2,
"rz": 123.03,
"w": 0.02,
"a_fsltdz": -5.27000000000001,
"rzTm": "2025-04-11T04:00:00.000Z",
"rzWarning": 0,
"rzState": 2,
"pic": [
{
"stcd": "716115601",
"tm": "2023-03-12T07:03:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/716115601/20230312150300.jpg"
},
{
"stcd": "716115601",
"tm": "2023-03-12T07:11:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/716115602/20230312151100.jpg"
}
],
"aRz": -5.27
},
{
"stcd": "716108601",
"type": "sk",
"hasRz": true,
"stnm": "吴家垸水库",
"adcd": "421181110000",
"wscd": null,
"importancy": 0,
"lgtd": 115.029167,
"lttd": 31.427222,
"elev": 0,
"damel": 15.7,
"dsflz": 13.85,
"fsltdz": 173.9,
"ddz": 4.6,
"zcxsw": 173.9,
"drpTm": "2025-04-11T05:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 0,
"drpState": 2,
"rz": 169.14,
"w": 0.11,
"a_fsltdz": -4.760000000000019,
"rzTm": "2025-04-11T05:00:00.000Z",
"rzWarning": 0,
"rzState": 2,
"pic": [
{
"stcd": "716108601",
"tm": "2023-03-12T08:01:41.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/716108601/20230312160141.jpg"
},
{
"stcd": "716108601",
"tm": "2023-03-12T07:04:17.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/716108602/20230312150417.jpg"
}
],
"aRz": -4.76
},
{
"stcd": "716113401",
"type": "sk",
"hasRz": true,
"stnm": "鲇鱼坝水库",
"adcd": "421181102000",
"wscd": null,
"importancy": 0,
"lgtd": 114.731667,
"lttd": 31.019444,
"elev": 0,
"damel": 55.73,
"dsflz": 52.9,
"fsltdz": 50.63,
"ddz": 42.83,
"zcxsw": 50.63,
"drpTm": "2025-04-11T05:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 0,
"drpState": 2,
"rz": 48.05,
"w": 2.584,
"a_fsltdz": -2.5800000000000054,
"rzTm": "2025-04-11T05:00:00.000Z",
"rzWarning": 0,
"rzState": 2,
"pic": [
{
"stcd": "716113401",
"tm": "2023-03-12T07:07:01.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/716113401/20230312150701.jpg"
},
{
"stcd": "716113401",
"tm": "2023-03-12T07:15:09.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/716113402/20230312151509.jpg"
}
],
"aRz": -2.58
},
{
"stcd": "716126501",
"type": "sk",
"hasRz": true,
"stnm": "破堰水库",
"adcd": "421181102000",
"wscd": null,
"importancy": 0,
"lgtd": 114.696111,
"lttd": 31.025556,
"elev": 0,
"damel": 18.48,
"dsflz": 15.23,
"fsltdz": 74.2,
"ddz": 6.3,
"zcxsw": 74.2,
"drpTm": "2025-04-11T05:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 0,
"drpState": 2,
"rz": 64.47,
"w": 0.265,
"a_fsltdz": -9.730000000000004,
"rzTm": "2025-04-11T05:00:00.000Z",
"rzWarning": 0,
"rzState": 2,
"pic": [
{
"stcd": "716126501",
"tm": "2023-03-12T07:04:21.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/716126501/20230312150421.jpg"
},
{
"stcd": "716126501",
"tm": "2023-03-12T07:10:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/716126502/20230312151000.jpg"
}
],
"aRz": -9.73
},
{
"stcd": "716107371",
"type": "sk",
"hasRz": true,
"stnm": "群英水库",
"adcd": "421181102000",
"wscd": null,
"importancy": 0,
"lgtd": 114.726944,
"lttd": 31.054444,
"elev": 0,
"damel": 7.4,
"dsflz": 6.02,
"fsltdz": 65.6,
"ddz": 4.1,
"zcxsw": 65.6,
"drpTm": "2025-04-11T05:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 0,
"drpState": 2,
"rz": 68.66,
"w": 0,
"a_fsltdz": 3.0600000000000023,
"rzTm": "2025-04-11T05:00:00.000Z",
"rzWarning": 1,
"rzState": 2,
"pic": [
{
"stcd": "716107371",
"tm": "2023-03-12T07:23:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/716107371/20230312152300.jpg"
},
{
"stcd": "716107371",
"tm": "2023-03-12T07:16:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/716107372/20230312151600.jpg"
}
],
"aRz": 3.06
},
{
"stcd": "716126301",
"type": "sk",
"hasRz": true,
"stnm": "淮海水库",
"adcd": "421181102000",
"wscd": null,
"importancy": 0,
"lgtd": 114.694722,
"lttd": 31.053333,
"elev": 0,
"damel": 11.2,
"dsflz": 9.97,
"fsltdz": 9.6,
"ddz": 6.3,
"zcxsw": 9.6,
"drpTm": "2025-04-11T05:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 0,
"drpState": 2,
"rz": 64.96,
"w": 0.129,
"a_fsltdz": 55.35999999999999,
"rzTm": "2025-04-11T05:00:00.000Z",
"rzWarning": 1,
"rzState": 2,
"pic": [
{
"stcd": "716126301",
"tm": "2023-03-12T07:04:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/716126301/20230312150400.jpg"
},
{
"stcd": "716126301",
"tm": "2023-03-12T07:10:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/716126302/20230312151000.jpg"
}
],
"aRz": 55.36
},
{
"stcd": "716108501",
"type": "sk",
"hasRz": true,
"stnm": "东风水库",
"adcd": "421181102000",
"wscd": null,
"importancy": 0,
"lgtd": 115.232222,
"lttd": 30.970556,
"elev": 0,
"damel": 81.7,
"dsflz": 80.22,
"fsltdz": 79,
"ddz": 76.2,
"zcxsw": 79,
"drpTm": "2025-03-22T08:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 0,
"drpState": 2,
"rz": 78.22,
"w": 0.203,
"a_fsltdz": -0.7800000000000011,
"rzTm": "2025-03-22T08:00:00.000Z",
"rzWarning": 0,
"rzState": 2,
"pic": [
{
"stcd": "716108501",
"tm": "2024-09-08T02:44:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2024/0908/716108501/20240908104400.jpg"
},
{
"stcd": "716108501",
"tm": "2024-08-26T09:20:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2024/0826/716108502/20240826172000.jpg"
}
],
"aRz": -0.78
},
{
"stcd": "716126601",
"type": "sk",
"hasRz": true,
"stnm": "毛屋湾水库",
"adcd": "421181102000",
"wscd": null,
"importancy": 0,
"lgtd": 114.693889,
"lttd": 31.019722,
"elev": 0,
"damel": 10,
"dsflz": 9.8,
"fsltdz": 66.57,
"ddz": 5,
"zcxsw": 66.57,
"drpTm": "2024-12-30T06:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 0,
"drpState": 2,
"rz": 65.41,
"w": 0.039,
"a_fsltdz": -1.1599999999999966,
"rzTm": "2024-05-15T06:00:00.000Z",
"rzWarning": 0,
"rzState": 2,
"pic": [
{
"stcd": "716126601",
"tm": "2024-03-11T02:02:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2024/0311/716126601/20240311100200.jpg"
},
{
"stcd": "716126601",
"tm": "2024-05-15T06:07:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2024/0515/716126602/20240515140700.jpg"
}
],
"aRz": -1.16
},
{
"stcd": "7CS000081",
"type": "sk",
"hasRz": true,
"stnm": "陡山洪水库",
"adcd": "421181102000",
"wscd": null,
"importancy": 0,
"lgtd": 114.724722,
"lttd": 31.007222,
"elev": 0,
"damel": 56.7,
"dsflz": 55.6,
"fsltdz": 5.8,
"ddz": 49.71,
"zcxsw": 5.8,
"drpTm": "2025-04-11T05:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 0,
"drpState": 2,
"rz": 51.26,
"w": 0.034,
"a_fsltdz": 45.46,
"rzTm": "2025-04-11T05:00:00.000Z",
"rzWarning": 1,
"rzState": 2,
"pic": [
{
"stcd": "7CS000081",
"tm": "2023-03-12T08:01:48.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/7CS000081/20230312160148.jpg"
},
{
"stcd": "7CS000081",
"tm": "2023-03-12T07:05:33.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/7CS000082/20230312150533.jpg"
}
],
"aRz": 45.46
},
{
"stcd": "716107391",
"type": "sk",
"hasRz": true,
"stnm": "高岗水库",
"adcd": "421181102000",
"wscd": null,
"importancy": 0,
"lgtd": 114.731389,
"lttd": 31.042222,
"elev": 0,
"damel": 41.7,
"dsflz": 41.6,
"fsltdz": 40,
"ddz": 35.56,
"zcxsw": 40,
"drpTm": "2025-04-11T05:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 0,
"drpState": 2,
"rz": 51.42,
"w": 0.044,
"a_fsltdz": 11.420000000000002,
"rzTm": "2025-04-11T05:00:00.000Z",
"rzWarning": 1,
"rzState": 2,
"pic": [
{
"stcd": "716107391",
"tm": "2023-03-12T07:03:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/716107391/20230312150300.jpg"
},
{
"stcd": "716107391",
"tm": "2023-03-12T07:10:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/716107392/20230312151000.jpg"
}
],
"aRz": 11.42
},
]
export default class XunchaLayer extends BaseLayer {
static LayerName = 'XunchaLayer';
static SourceName = SourceName;
getStyle() {
const ret = clone(ShapeStyle);
this._setStyleVisibility(ret);
return ret;
}
getName() {
return XunchaLayer.LayerName;
}
getSubLayers() {
return [ShapeStyle.id];
}
async doRefreshLayer(mapCtrl) {
const ms = mapCtrl.getSource(SourceName);
let data =
// await PicStPromise.get();
[...page1].map((item)=>{
const obj = {...item}
obj.lgtd = item.lgtd + 0.0019
obj.lttd = item.lttd
return obj
})
ms.setData(parseGeoJSON(data));
return true;
}
getFeatureTip(record) {
return '';
}
featureClicked(properties, dispatch) {
dispatch?.runtime.setInfoDlg({ layerId: 'XcxqLayer', properties: {} })
}
}