123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- import Bus from '@/utils/bus'
- const blueColor = '0,0.958507,1,1'
- const redColor = '0.583333,0.037082,0,1'
- const yellowColor = '0,0.583333,0.021181,1'
- /**
- * 降雨颜色
- * @param {*} val
- * @returns
- */
- export function getColorByWaterQuality(val: number) {
- if (!val) {
- return '1,1,1'
- }
- switch (val) {
- case 1:
- return '0,0.894330,1,1'
- case 2:
- return '0.362375,1,0.276435,1'
- case 3:
- return '0,0.583333,0.021181,1'
- case 4:
- return '0.583333,0.037082,0,1'
- case 5:
- return '0,0.583333,0.021181,1'
- default:
- return ''
- }
- }
- export function underWater(show = true) {
- let descriptor = {
- command: 'Underwater',
- data: {
- Type: show ? 'True' : 'False',
- },
- }
- Bus.emit('emitUIInteraction', descriptor)
- console.log('-- 水下地形:', JSON.stringify(descriptor))
- }
- export function taihuForecast(type = 'Windy', time: string, show = true) {
- debugger
- if (type === 'Windy') {
- windyIndex++
- if (windyIndex % 5 !== 0) {
- return
- }
- }
- let descriptor: any = {
- command: type,
- data: {
- Time: time,
- Display: show ? 'true' : 'false',
- },
- }
- Bus.emit('emitUIInteraction', descriptor)
- console.log('-- ' + type + ' 图层:', JSON.stringify(descriptor))
- }
- let windyIndex = -1
- export function closeTaihuForecast() {
- taihuForecast('Windy', '', false)
- taihuForecast('Humiture', '', false)
- windyIndex = -1
- }
- export function radarMap(url: any, show = true) {
- let descriptor = {
- command: 'RadarMap',
- data: {
- Url: url,
- Type: 'RadarMap',
- Display: show ? 'true' : 'false',
- },
- }
- Bus.emit('emitUIInteraction', descriptor)
- console.log('-- radarMap 图层:', JSON.stringify(descriptor))
- }
|