{"version":3,"file":"WeatherServiceImpl.mjs","sources":["../../../../../../packages/sdk/plugins/weather/WeatherServiceImpl.ts"],"sourcesContent":["import L from 'leaflet'\nimport { isEmpty } from 'lodash-unified'\nimport { CanvasShipUtils } from '@map-sdk/sdk/utils/CanvasShipUtils'\nimport { CommUtils } from '@map-sdk/sdk/utils/CommUtils'\nimport { ShipxyOptions } from '@map-sdk/sdk/config'\nimport { TideService } from '@map-sdk/sdk/plugins/weather/Tides/TideService'\nimport { typhoonInfoList } from '@map-sdk/sdk/plugins/weather/Typhoon/TyphonInfoList'\nimport {\n  SeaAreaForecastService,\n  SeaForecast,\n} from '@map-sdk/sdk/plugins/weather/Sea/SeaAreaForecastService'\nimport { FullScreenSymbol } from '@map-sdk/sdk/plugins/weather/util/FullScreenSymbol'\nimport { ShowFullScreenTitleLayer } from '@map-sdk/sdk/plugins/weather/util/ShowFullScreenTitleLayer'\nimport { windyService } from '@map-sdk/sdk/plugins/weather/Weather/WindyService'\nimport { TyphoonService } from '@map-sdk/sdk/plugins/weather/Typhoon/TyphoonService'\nimport type { TyphonInfoList } from '@map-sdk/sdk/plugins/weather/Typhoon/TyphonInfoList'\nimport type {\n  PathPoint,\n  TyphoonDetails,\n} from '@map-sdk/sdk/plugins/weather/Typhoon/TyphoonService'\nimport type { SeaForecastInterFaca } from '@map-sdk/sdk/plugins/weather/Sea/SeaAreaForecastService'\nimport type { WindyService } from '@map-sdk/sdk/plugins/weather/Weather/WindyService'\nimport type { LTileLayerFunctionalOptions } from '@map-sdk/sdk/plugins/weather/util/ShowFullScreenTitleLayer'\nimport type { MyMap } from '@map-sdk/sdk/ShipxyAPISDK'\n\ntype WeatherServiceOptions = LTileLayerFunctionalOptions\n\nexport class WeatherServiceImpl extends ShowFullScreenTitleLayer {\n  private _QBBeginTime: any\n  private _refash_QBBeginTime: number | undefined\n  private _SeaBreezes?: FullScreenSymbol\n  private _SeaWater?: FullScreenSymbol\n  private _RainFall?: FullScreenSymbol\n  private _TyphoonInfoList?: TyphonInfoList // 需要具体类型定义\n  private _windFiel?: WindyService\n  private _oceanCurrentFiel?: WindyService\n  private _haiquyubao: SeaAreaForecastService = new SeaAreaForecastService(\n    this._map\n  )\n  private _tideService?: TideService\n  private _typhoon: TyphoonService | undefined\n\n  constructor(map: MyMap, options?: WeatherServiceOptions) {\n    super(map, options)\n    this._QBBeginTime = {}\n  }\n\n  /**\n   * 通用方法 显示\n   * 水温 0\n   * 冰情 1\n   * 海冰 2\n   * 海风 3\n   * 海风箭头 4\n   * 降雨量 5\n   * 气压 6\n   * 能见度 7\n   * 气温 8\n   * 海浪 9\n   * 海浪箭头 10\n   * @param type\n   * @param time\n   */\n  public showWeatherLayerTile(type: string, time: string): void {\n    CanvasShipUtils.openLoadingPopup(50, () => {\n      try {\n        this.updateQBBeginTime()\n        this.showFullScreenTileLayer(type, time, this._QBBeginTime)\n      } catch (e) {\n        console.error(e)\n      }\n      CanvasShipUtils.closeLoadingPopup()\n    })\n  }\n\n  public hideWeatherLayerTile(type?: string) {\n    this.hideFullScreenTileLayer(type)\n    CanvasShipUtils.closeLoadingPopup()\n  }\n\n  // 显示气温面的逻辑\n  public showTempTile(time: string): void {\n    CanvasShipUtils.openLoadingPopup(50, () => {\n      try {\n        this.updateQBBeginTime()\n        this.showFullScreenTileLayer('12', time, this._QBBeginTime)\n      } catch (e) {\n        console.error(e)\n      }\n      CanvasShipUtils.closeLoadingPopup()\n    })\n  }\n  // 隐藏气温面的逻辑\n  public hideTempTile(): void {\n    this.hideFullScreenTileLayer()\n    CanvasShipUtils.closeLoadingPopup()\n  }\n\n  /**\n   * 显示气压面\n   */\n  showPressureTile(time: any) {\n    CanvasShipUtils.openLoadingPopup(50, () => {\n      try {\n        this.updateQBBeginTime()\n        this.showFullScreenTileLayer('11', time, this._QBBeginTime)\n      } catch (e) {\n        console.error(e)\n      }\n      CanvasShipUtils.closeLoadingPopup()\n    })\n  }\n  /**\n   *  隐藏气压面\n   */\n  hidePressureTile() {\n    this.hideFullScreenTileLayer()\n    CanvasShipUtils.closeLoadingPopup()\n  }\n  /**\n   * 显示海风符号\n   */\n  showSeaBreezes(time: string, data: any) {\n    CanvasShipUtils.openLoadingPopup(50, () => {\n      try {\n        this.updateQBBeginTime()\n        this._SeaBreezes ||\n          (this._SeaBreezes = new FullScreenSymbol(this._map, 13, data))\n        this._SeaBreezes.show(time, this._QBBeginTime)\n      } catch (e) {\n        console.error(e)\n      }\n      CanvasShipUtils.closeLoadingPopup()\n    })\n  }\n  /**\n   * 隐藏海风符号\n   */\n  hideSeaBreezes() {\n    this._SeaBreezes && this._SeaBreezes.remove()\n    CanvasShipUtils.closeLoadingPopup()\n  }\n\n  /**显示海流符号 */\n  showSeaWater(time: any, data: any) {\n    CanvasShipUtils.openLoadingPopup(50, () => {\n      try {\n        this.updateQBBeginTime()\n        this._SeaWater ||\n          (this._SeaWater = new FullScreenSymbol(this._map, 15, data))\n        this._SeaWater.show(time, this._QBBeginTime)\n      } catch (e) {\n        console.error(e)\n      }\n      CanvasShipUtils.closeLoadingPopup()\n    })\n  }\n  /**隐藏海流符号 */\n  hideSeaWater() {\n    this._SeaWater && this._SeaWater.remove()\n    CanvasShipUtils.closeLoadingPopup()\n  }\n  /**显示降水符号 */\n  showRainFall(time: any) {\n    CanvasShipUtils.openLoadingPopup(50, () => {\n      try {\n        this.updateQBBeginTime()\n        this._RainFall || (this._RainFall = new FullScreenSymbol(this._map, 16))\n        this._RainFall.show(time, this._QBBeginTime)\n      } catch (error) {\n        console.error(error)\n      }\n      CanvasShipUtils.closeLoadingPopup()\n    })\n  }\n  /**隐藏降水符号 */\n  hideRainFall() {\n    this._RainFall && this._RainFall.remove()\n    CanvasShipUtils.closeLoadingPopup()\n  }\n  getTyphoonInfo(\n    item: any,\n    isChecked: boolean,\n    closeCallback: any,\n    showWinList: any,\n    noIngCallback: any,\n    cbLoadData: any,\n    other: any\n  ) {\n    if (!this._TyphoonInfoList) {\n      this._TyphoonInfoList = typhoonInfoList(this._map, {\n        ...other,\n        weatherService: this,\n        closeCallback,\n        noIngCallback,\n        showWinList,\n        cbLoadData,\n      })\n    }\n    // lastValueFrom(getWeatherTyphoonDetail({ tfbh: item.id }))\n    this._TyphoonInfoList.selectItem(item, isChecked)\n  }\n  /**显示台风列表控件 */\n  showTyphoonInfoList(\n    closeCallback: any,\n    showWinList: any,\n    noIngCallback: any,\n    cbLoadData: any,\n    other: any\n  ) {\n    CanvasShipUtils.openLoadingPopup(50, () => {\n      try {\n        if (!this._TyphoonInfoList) {\n          this._TyphoonInfoList = typhoonInfoList(this._map, {\n            ...other,\n            weatherService: this,\n            closeCallback,\n            noIngCallback,\n            showWinList,\n            cbLoadData,\n          })\n        }\n        this._TyphoonInfoList.show()\n      } catch (e) {\n        console.error(e)\n      }\n      CanvasShipUtils.closeLoadingPopup()\n    })\n  }\n  /**隐藏台风列表控件 */\n  hideTyphoonInfoList() {\n    this._TyphoonInfoList && this._TyphoonInfoList.remove()\n    this.hideTyphoon()\n    CanvasShipUtils.closeLoadingPopup()\n  }\n  /**显示风场 */\n  showWindFiel(forecastTime: string, data?: any) {\n    CanvasShipUtils.openLoadingPopup(50, () => {\n      try {\n        this.updateQBBeginTime()\n        this._windFiel ||\n          (this._windFiel = windyService(this._map, {\n            type: 13,\n            data,\n          }))\n        this._windFiel.show(forecastTime, this._QBBeginTime)\n      } catch (error) {\n        console.error(error)\n      }\n      CanvasShipUtils.closeLoadingPopup()\n    })\n  }\n  /**隐藏风场 */\n  hideWindFiel() {\n    this._windFiel && this._windFiel.hide()\n    CanvasShipUtils.closeLoadingPopup()\n  }\n  /**洋流 */\n  showOceanCurrentFiel(layer: any, data: any) {\n    CanvasShipUtils.openLoadingPopup(50, () => {\n      try {\n        this.updateQBBeginTime()\n        this._oceanCurrentFiel ||\n          (this._oceanCurrentFiel = windyService(this._map, {\n            type: 15,\n            data,\n          }))\n        this._oceanCurrentFiel.show(layer, this._QBBeginTime)\n      } catch (e) {\n        console.error(e)\n      }\n      CanvasShipUtils.closeLoadingPopup()\n    })\n  }\n  hideOceanCurrentFiel() {\n    this._oceanCurrentFiel && this._oceanCurrentFiel.hide()\n    CanvasShipUtils.closeLoadingPopup()\n  }\n  /**显示海区预报 */\n  showSeaAreaForecasts(\n    getDataListFunction: (done: (data: SeaForecastInterFaca[]) => void) => void,\n    cbFunction?: (params: any) => void\n  ) {\n    CanvasShipUtils.openLoadingPopup(50, () => {\n      try {\n        const done = (data: SeaForecastInterFaca[]) => {\n          // 全部\n          this._haiquyubao.addSeaForecasts(4, this.dealSeaForecastData(data))\n          cbFunction && this._haiquyubao.addEventCallbackListener(cbFunction)\n        }\n        getDataListFunction(done)\n\n        // const jinhaiUrl = ShipxyOptions.weather.jinhaiUrl\n        // //近海\n        // this._haiquyubao.addSeaForecasts(\n        //   2,\n        //   this.dealSeaForecastData(weatherData['2'].data)\n        // )\n\n        // //沿岸\n        // const yananUrl = ShipxyOptions.weather.yananUrl\n        // this._haiquyubao.addSeaForecasts(\n        //   1,\n        //   this.dealSeaForecastData(weatherData['1'].data)\n        // )\n\n        // //远海\n        // const yuanhaiUrl = ShipxyOptions.weather.yuanhaiUrl\n        // this._haiquyubao.addSeaForecasts(\n        //   3,\n        //   this.dealSeaForecastData(weatherData['3'].data)\n        // )\n\n        // console.log(\n        //   'TODO: showSeaAreaForecasts',\n        //   jinhaiUrl,\n        //   yananUrl,\n        //   yuanhaiUrl\n        // )\n\n        this._map.off('zoomend', this._showSeaAreaForecasts_zoomend, this)\n        this._map.on('zoomend', this._showSeaAreaForecasts_zoomend, this)\n      } catch (error) {\n        console.error(error)\n      }\n    })\n  }\n  _showSeaAreaForecasts_zoomend() {\n    this._haiquyubao && this._haiquyubao._drawSeaForecasts()\n  }\n  dealSeaForecastData(list: SeaForecastInterFaca[]): SeaForecast[] {\n    const seaForecasts: SeaForecast[] = []\n    for (const item of list) {\n      const seaForecast = new SeaForecast()\n      seaForecast.seaarea = item.seaarea\n      seaForecast.centerlatitude = `${item.centerlatitude}`\n      seaForecast.centerlongititude = item.centerlongititude\n      seaForecast.publishtime = item.publishtime\n      if (item.publishtime) {\n        seaForecast.publishdate = new Date(\n          item.publishtime.split('日')[0].replace('年', '-').replace('月', '-')\n        )\n        const weatherdetailList: WeatherDetail[] = []\n        if (item.weatherdetail && item.weatherdetail.length > 0)\n          for (let j = 0; j < item.weatherdetail.length; j += 2) {\n            const weatherDetail = new WeatherDetail()\n            L.Util.extend(weatherDetail, item.weatherdetail[j])\n            if (!CommUtils.isEmpty(weatherDetail.forecastaging)) {\n              if (0 == j) {\n                weatherDetail.publishdate = seaForecast.publishdate\n                weatherDetail.publishtime = CommUtils.dataFormat(\n                  weatherDetail.publishdate,\n                  'MM月DD日'\n                )\n                seaForecast.forecastaging_str = '未来24小时'\n              }\n              if (2 == j) {\n                weatherDetail.publishdate = new Date(\n                  seaForecast.publishdate.getTime() + 86400000\n                )\n                weatherDetail.publishtime = CommUtils.dataFormat(\n                  weatherDetail.publishdate,\n                  'MM月DD日'\n                )\n                seaForecast.forecastaging_str = '未来48小时'\n              }\n              if (4 == j) {\n                weatherDetail.publishdate = new Date(\n                  seaForecast.publishdate.getTime() + 172800000\n                )\n                weatherDetail.publishtime = CommUtils.dataFormat(\n                  weatherDetail.publishdate,\n                  'MM月DD日'\n                )\n                seaForecast.forecastaging_str = '未来72小时'\n              }\n\n              weatherDetail.meteorological_icon =\n                item.weatherdetail[j].meteorological\n              weatherDetail.meteorological =\n                item.weatherdetail[j].meteorological\n              CanvasShipUtils.isEmpty(item.weatherdetail[j].meteorological) ||\n                item.weatherdetail[j].meteorological ==\n                  item.weatherdetail[j + 1].meteorological ||\n                (weatherDetail.meteorological =\n                  `${item.weatherdetail[j].meteorological} ` +\n                  `转` +\n                  ` ${item.weatherdetail[j + 1].meteorological}`)\n              weatherDetail.winddirection = item.weatherdetail[j].winddirection\n              CanvasShipUtils.isEmpty(item.weatherdetail[j].winddirection) ||\n                item.weatherdetail[j].winddirection ==\n                  item.weatherdetail[j + 1].winddirection ||\n                (weatherDetail.winddirection =\n                  `${item.weatherdetail[j].winddirection} ` +\n                  `转` +\n                  ` ${item.weatherdetail[j + 1].winddirection}`)\n              weatherDetail.windpower = item.weatherdetail[j].windpower\n              CanvasShipUtils.isEmpty(item.weatherdetail[j].windpower) ||\n                item.weatherdetail[j].windpower ==\n                  item.weatherdetail[j + 1].windpower ||\n                (weatherDetail.windpower =\n                  `${item.weatherdetail[j].windpower} ` +\n                  `转` +\n                  ` ${item.weatherdetail[j + 1].windpower}`)\n              weatherDetail.visibility = item.weatherdetail[j].visibility\n              CanvasShipUtils.isEmpty(item.weatherdetail[j].visibility) ||\n                item.weatherdetail[j].visibility ==\n                  item.weatherdetail[j + 1].visibility ||\n                (weatherDetail.visibility =\n                  `${item.weatherdetail[j].visibility} ` +\n                  `转` +\n                  ` ${item.weatherdetail[j + 1].visibility}`)\n              weatherDetail.waveheight = `${item.weatherdetail[j].waveheight}`\n              CanvasShipUtils.isEmpty(item.weatherdetail[j].waveheight) ||\n                item.weatherdetail[j].waveheight ==\n                  item.weatherdetail[j + 1].waveheight ||\n                (weatherDetail.waveheight =\n                  `${item.weatherdetail[j].waveheight} ` +\n                  `转` +\n                  ` ${item.weatherdetail[j + 1].waveheight}`)\n              weatherdetailList.push(weatherDetail)\n            }\n          }\n        seaForecast.weatherdetail = weatherdetailList as any\n        weatherdetailList.length > 0 &&\n          (seaForecast.meteorological =\n            weatherdetailList[0].meteorological_icon)\n        seaForecasts.push(seaForecast)\n      }\n    }\n    return seaForecasts\n  }\n  /**隐藏海区预报 */\n  hideSeaAreaForecasts() {\n    this._haiquyubao && this._haiquyubao.close()\n    this._map.off('zoomend', this._showSeaAreaForecasts_zoomend, this)\n    CanvasShipUtils.closeLoadingPopup()\n  }\n  /**显示潮汐预报 */\n  showTides() {\n    CanvasShipUtils.openLoadingPopup(50, () => {\n      try {\n        this._tideService || (this._tideService = new TideService(this._map))\n        this._tideService.addTides()\n      } catch (error) {\n        console.error(error)\n      }\n      CanvasShipUtils.closeLoadingPopup()\n    })\n  }\n  /**隐藏潮汐预报 */\n  hideTides() {\n    this._tideService && this._tideService.close()\n    CanvasShipUtils.closeLoadingPopup()\n  }\n  /**\n   * 显示台风\n   * @param pathPoints\n   * @param typhoonDetails\n   */\n  showTyphoon(\n    pathPoints: PathPoint[],\n    typhoonDetails: TyphoonDetails,\n    options: any\n  ) {\n    this._typhoon || (this._typhoon = new TyphoonService(this._map, options))\n    return this._typhoon.showTyphoon(pathPoints, typhoonDetails)\n  }\n\n  _parseRawTyphoon(rawTyphoonData: any, options: any) {\n    this._typhoon || (this._typhoon = new TyphoonService(this._map, options))\n    return this._typhoon.parseRawTyphoon(rawTyphoonData)\n  }\n  hideTyphoon(type?: string) {\n    try {\n      if (this._typhoon) {\n        CanvasShipUtils.isEmpty(type) && (type = 'all')\n        this._typhoon.hideTyphoon(type)\n        'all' == type && (this._typhoon = undefined)\n      }\n    } catch (error) {\n      console.error(error)\n    }\n    CanvasShipUtils.closeLoadingPopup()\n  }\n  updateQBBeginTime() {\n    if (\n      !(\n        (ShipxyOptions.versionType &&\n          ShipxyOptions.versionType.includes('API')) ||\n        (this._refash_QBBeginTime &&\n          Date.now() - this._refash_QBBeginTime < 3600000)\n      )\n    ) {\n      // $.ajax({\n      //   url: ShipxyOptions.weather.getQBBeginTimeURL,\n      //   timeout: 5000,\n      //   success: (res: { status: number; data: string | any[] }) => {\n      //     if (res && 0 == res.status && res.data) {\n      //       for (let i = 0; i < res.data.length; i++) {\n      //         const item = res.data[i]\n      //         const typeStr = 'type_' + item.type\n      //         this._QBBeginTime[typeStr] = item\n      //       }\n      //       this._refash_QBBeginTime = new Date().getTime()\n      //     }\n      //   },\n      //   error() {\n      //     console.error('[气象服务]获取起报时间错误')\n      //   }\n      // })\n      console.log(\n        'TODO: updateQBBeginTime',\n        ShipxyOptions.weather.getQBBeginTimeURL\n      )\n      return this._QBBeginTime\n    }\n  }\n  /**获取鼠标位置，经纬度对应的气象数据 */\n  getLatLngWeather(type: string, latlng: any, sTime: string | Date) {\n    const result = null\n    if (isEmpty(latlng)) return result\n    if (isEmpty(sTime)) {\n      sTime = this.getCurDate()\n      latlng = L.latLng(latlng)\n      this.updateQBBeginTime()\n    }\n    const types = `${type}`.split(',')\n    const times: string[] = []\n    if (\n      ShipxyOptions.versionType &&\n      !ShipxyOptions.versionType.includes('API')\n    ) {\n      for (const type_ of types) {\n        let date = `${CanvasShipUtils.dataFormat(\n          new Date(),\n          'YYYY-MM-DD'\n        )} 20:00:00`\n        const typeStr = `type_${type_}`\n        if (this._QBBeginTime && typeStr in this._QBBeginTime) {\n          date = this._QBBeginTime[typeStr].time\n          times.push(date)\n        }\n      }\n    }\n    const url = ShipxyOptions.weather.getLatLngWeatherURL\n      .replace('{type}', type)\n      .replace('{time}', times.join(','))\n      .replace('{forecasttime}', sTime.toString())\n      .replace('{x}', `${CanvasShipUtils.lngTo180(latlng.lng)}`)\n      .replace('{y}', latlng.lat)\n    console.log('TODO:', url)\n    return result\n  }\n  /**获取鼠标位置，经纬度对应的气象数据 */\n  // getLatLngWeatherAPI(\n  //   type: string,\n  //   latlng:\n  //     | string\n  //     | number\n  //     | string[]\n  //     | L.LatLngLiteral\n  //     | L.LatLngTuple\n  //     | null\n  //     | undefined,\n  //   sTime: string | number | string[] | Date | null | undefined,\n  //   cb: (arg0: any) => void\n  // ) {\n  //   let result = null\n  //   if (CommUtils.isEmpty(latlng)) return result\n  //   if (CommUtils.isEmpty(sTime)) {\n  //     sTime = this.getCurDate()\n  //     latlng = L.latLng(latlng)\n  //     this.updateQBBeginTime()\n  //   }\n  //   const types = (type + '').split(',')\n  //   const times = []\n  //   if (\n  //     ShipxyOptions.versionType &&\n  //     ShipxyOptions.versionType.indexOf('API') < 0\n  //   ) {\n  //     for (let i = 0; i < types.length; i++) {\n  //       let date =\n  //         CanvasShipUtils.dataFormat(new Date(), 'YYYY-MM-DD') + ' 20:00:00'\n  //       const typeStr = 'type_' + types[i]\n  //       if (this._QBBeginTime && typeStr in this._QBBeginTime) {\n  //         date = this._QBBeginTime[typeStr].time\n  //         times.push(date)\n  //       }\n  //     }\n  //     if (types.length != times.length) {\n  //       console.error('气象栅格图层，气象类型与起报时间不成对！')\n  //       return\n  //     }\n  //   }\n  //   const url = ShipxyOptions.weather.getLatLngWeatherURLAPI\n  //     .replace('{k}', '07b733dd6c0d4d74bd25dbbe2049d4c7')\n  //     .replace('{lon}', CanvasShipUtils.lngTo180(latlng.lng))\n  //     .replace('{lat}', latlng.lat)\n  //     .replace('{time}', sTime)\n  //   if ($.isFunction(cb)) {\n  //     jQuery.getJSON(url, function (res: any) {\n  //       cb(res)\n  //     })\n  //   } else {\n  //     jQuery.ajaxSettings.async = false\n  //     jQuery.getJSON(url, function (res: any) {\n  //       result = res\n  //     })\n  //     jQuery.ajaxSettings.async = true\n  //   }\n\n  //   return result\n  // }\n  /**\n   * @retrun 2018-05-15 20:00:00\n   */\n  getCurDate(nowDate?: Date, isNow?: boolean): string | Date {\n    !nowDate && (nowDate = new Date())\n    !isNow && (isNow = true)\n    let curDate: Date | string = ''\n    const dateList: string[] = []\n    const nowDateFormat = CommUtils.dataFormat(nowDate, 'YYYY-MM-DD')\n    dateList.push(\n      `${CommUtils.dataFormat(\n        nowDate.getTime() - 34560000,\n        'YYYY-MM-DD'\n      )} 20:00:00`,\n      `${nowDateFormat} 02:00:00`,\n      `${nowDateFormat} 08:00:00`,\n      `${nowDateFormat} 14:00:00`,\n      `${nowDateFormat} 20:00:00`,\n      `${CommUtils.dataFormat(\n        nowDate.getTime() + 34560000,\n        'YYYY-MM-DD'\n      )} 02:00:00`\n    )\n    for (let i = 0; i < dateList.length; i++) {\n      curDate = new Date(dateList[i].replace(/\\\\-/g, '/'))\n      if (curDate.getTime() >= nowDate.getTime()) {\n        if (isNow) {\n          curDate = dateList[i]\n          break\n        }\n        curDate = dateList[i - 1]\n        break\n      }\n    }\n    return curDate\n  }\n  /** 隐藏所有显示 */\n  hideAll() {\n    this.hideTempTile()\n    this.hidePressureTile()\n    this.hideSeaBreezes()\n    this.hideSeaWater()\n    this.hideRainFall()\n    this.hideTides()\n    this.hideSeaAreaForecasts()\n    this.hideTyphoonInfoList()\n    this.hideWindFiel()\n    this.hideWeatherLayerTile()\n  }\n}\n\n/**\n * 天气数据服务\n */\nexport class WeatherDataServer {\n  ValueCountByType: {\n    11: number\n    12: number\n    13: number\n    14: number\n    15: number\n    16: number\n    18: number\n  }\n  constructor() {\n    this.ValueCountByType = {\n      11: 1,\n      12: 1,\n      13: 2,\n      14: 3,\n      15: 2,\n      16: 1,\n      18: 1,\n    }\n  }\n\n  weatherDataAnalysis = (resData: any, valueCount: number) => {\n    const weatherDatas = []\n    for (let i = 0; i < 65160; i++) {\n      const values = []\n      for (let i = 0; i < valueCount; i++) {\n        values.push(resData.readFloat32LE().toFixed(5))\n      }\n      weatherDatas.push({\n        value: values.join('/'),\n        x: 1000 * ((i % 360) - 180),\n        y: 1000 * (Number.parseInt(`${i / 360}`) + -90),\n      })\n    }\n    return weatherDatas\n  }\n}\n\n/**\n * 天气明细实体\n */\nexport class WeatherDetail {\n  publishtime = ''\n  publishdate: Date | null = null\n  forecastaging = ''\n  forecastaging_str = ''\n  meteorological = ''\n  visibility = ''\n  waveheight = ''\n  winddirection = ''\n  windpower = ''\n  meteorological_icon: any\n}\n"],"names":["WeatherServiceImpl","v","constructor","i","a","super","this","_haiquyubao","F","_map","_QBBeginTime","showWeatherLayerTile","o","openLoadingPopup","updateQBBeginTime","showFullScreenTileLayer","e","closeLoadingPopup","hideWeatherLayerTile","hideFullScreenTileLayer","showTempTile","hideTempTile","showPressureTile","hidePressureTile","showSeaBreezes","_SeaBreezes","p","show","hideSeaBreezes","remove","showSeaWater","_SeaWater","hideSeaWater","showRainFall","_RainFall","hideRainFall","getTyphoonInfo","r","n","t","s","_TyphoonInfoList","w","weatherService","closeCallback","noIngCallback","showWinList","cbLoadData","selectItem","showTyphoonInfoList","hideTyphoonInfoList","hideTyphoon","showWindFiel","_windFiel","_","type","data","hideWindFiel","hide","showOceanCurrentFiel","_oceanCurrentFiel","hideOceanCurrentFiel","showSeaAreaForecasts","addSeaForecasts","dealSeaForecastData","addEventCallbackListener","off","_showSeaAreaForecasts_zoomend","on","_drawSeaForecasts","L","seaarea","centerlatitude","centerlongititude","publishtime","publishdate","Date","split","replace","weatherdetail","length","WeatherDetail","y","Util","extend","h","isEmpty","forecastaging","dataFormat","forecastaging_str","getTime","meteorological_icon","meteorological","winddirection","windpower","visibility","waveheight","push","hideSeaAreaForecasts","close","showTides","_tideService","f","addTides","hideTides","showTyphoon","_typhoon","T","_parseRawTyphoon","parseRawTyphoon","l","versionType","includes","_refash_QBBeginTime","now","getLatLngWeather","g","getCurDate","latLng","S","m","u","time","weather","getLatLngWeatherURL","join","toString","lngTo180","lng","lat","hideAll","WeatherDataServer","weatherDataAnalysis","c","readFloat32LE","toFixed","value","x","Number","parseInt","ValueCountByType"],"mappings":"+rBAAg3B,MAAMA,UAA2BC,EAAE,WAAAC,CAAYC,EAAEC,GAAGC,MAAMF,EAAEC,GAAGE,KAAKC,YAAY,IAAIC,EAAEF,KAAKG,MAAMH,KAAKI,aAAa,EAAE,CAAC,oBAAAC,CAAqBR,EAAEC,GAAGQ,EAAEC,iBAAiB,IAAG,KAAK,IAAIP,KAAKQ,oBAAoBR,KAAKS,wBAAwBZ,EAAEC,EAAEE,KAAKI,aAAa,CAAC,MAAMM,GAAmB,CAACJ,EAAEK,sBAAqB,CAAC,oBAAAC,CAAqBf,GAAGG,KAAKa,wBAAwBhB,GAAGS,EAAEK,mBAAmB,CAAC,YAAAG,CAAajB,GAAGS,EAAEC,iBAAiB,IAAG,KAAK,IAAIP,KAAKQ,oBAAoBR,KAAKS,wBAAwB,KAAKZ,EAAEG,KAAKI,aAAa,CAAC,MAAMN,GAAmB,CAACQ,EAAEK,sBAAqB,CAAC,YAAAI,GAAef,KAAKa,0BAA0BP,EAAEK,mBAAmB,CAAC,gBAAAK,CAAiBnB,GAAGS,EAAEC,iBAAiB,IAAG,K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