{"version":3,"file":"DischargeAreaSymbol.mjs","sources":["../../../../../../../packages/sdk/plugins/AreaView/layer/DischargeAreaSymbol.ts"],"sourcesContent":["/*\n * @Author: Yolo\n * @Date: 2024-07-02 09:06:01\n * @Last Modified by: Yolo\n * @Last Modified time: 2024-07-02 09:09:06\n * @Desc 全球排放控制区\n */\nimport * as L from 'leaflet'\nimport { AreaViewBase } from '@map-sdk/sdk/plugins/AreaView/AreaViewBase'\nimport { ECAv2 } from '@map-sdk/sdk/plugins/AreaView/layer/DischargeAreaSymbolData'\nimport type { MyMap } from '@map-sdk/sdk/ShipxyAPISDK'\nimport type { AreaViewBaseOptions } from '@map-sdk/sdk/plugins/AreaView/AreaViewBase'\nclass DischargeAreaSymbol extends AreaViewBase {\n  constructor(map: MyMap, options?: Partial<AreaViewBaseOptions>) {\n    super(map, options)\n    this._data = ECAv2\n  }\n  _show(): this {\n    if (!this._data) {\n      console.error('区域图形展示，请求无数据！')\n      return this\n    }\n\n    for (let i = 0; i < this._data.length; i++) {\n      const areas = this._data[i].area\n      for (const area of areas) {\n        const lines = area.line\n        const latlngs1: L.LatLngExpression[] = []\n        const latlngs2: L.LatLngExpression[] = []\n\n        for (const line of lines) {\n          latlngs1.push(L.latLng(line.lat, line.lon))\n          latlngs2.push(L.latLng(line.lat, Number(line.lon) + 360))\n        }\n\n        if ('密闭' === this._data[i].property) {\n          latlngs1.push(L.latLng(lines[0].lat, lines[0].lon))\n          latlngs2.push(L.latLng(lines[0].lat, Number(lines[0].lon) + 360))\n        }\n\n        const polyline1 = L.polyline(latlngs1, {\n          color: '#169316',\n          dashArray: '7',\n          dashOffset: '4',\n          weight: 2,\n          ...this.options,\n        }).addTo(this._map)\n        this._areaLayers.push(polyline1)\n\n        const polyline2 = L.polyline(latlngs2, {\n          color: '#169316',\n          dashArray: '7',\n          dashOffset: '4',\n          weight: 2,\n          ...this.options,\n        }).addTo(this._map)\n        this._areaLayers.push(polyline2)\n      }\n    }\n\n    return this\n  }\n}\n\n// 创建工厂函数\nfunction dischargeAreaSymbol(\n  map: MyMap,\n  options: Partial<AreaViewBaseOptions>\n): DischargeAreaSymbol {\n  return new DischargeAreaSymbol(map, options)\n}\n\nexport { DischargeAreaSymbol, dischargeAreaSymbol }\n"],"names":["l","m","constructor","a","r","super","this","_data","c","_show","length","area","p","t","line","o","i","e","push","s","latLng","lat","lon","Number","property","h","polyline","color","dashArray","dashOffset","weight","options","addTo","_map","_areaLayers","d","y","n"],"mappings":"mIAAwL,MAAMA,UAAUC,EAAE,WAAAC,CAAYC,EAAEC,GAAGC,MAAMF,EAAEC,GAAGE,KAAKC,MAAMC,CAAC,CAAC,KAAAC,GAAQ,IAAIH,KAAKC,MAAM,OAAuGD,KAAK,IAAI,IAAIH,EAAE,EAAEA,EAAEG,KAAKC,MAAMG,OAAOP,IAAI,CAAC,MAAMC,EAAEE,KAAKC,MAAMJ,GAAGQ,KAAK,IAAI,MAAMC,KAAKR,EAAE,CAAC,MAAMS,EAAED,EAAEE,KAAKC,EAAE,GAAGC,EAAE,GAAG,IAAI,MAAMC,KAAKJ,EAAEE,EAAEG,KAAKC,EAAEC,OAAOH,EAAEI,IAAIJ,EAAEK,MAAMN,EAAEE,KAAKC,EAAEC,OAAOH,EAAEI,IAAIE,OAAON,EAAEK,KAAK,MAA+B,OAAzBhB,KAAKC,MAAMJ,GAAGqB,WAA4BT,EAAEG,KAAKC,EAAEC,OAAOP,EAAE,GAAGQ,IAAIR,EAAE,GAAGS,MAAMN,EAAEE,KAAKC,EAAEC,OAAOP,EAAE,GAAGQ,IAAIE,OAAOV,EAAE,GAAGS,KAAK,OAAO,MAAMG,EAAEN,EAAEO,SAASX,EAAE,CAACY,MAAM,UAAUC,UAAU,IAAIC,WAAW,IAAIC,OAAO,KAAKxB,KAAKyB,UAAUC,MAAM1B,KAAK2B,MAAM3B,KAAK4B,YAAYhB,KAAKO,GAAG,MAAMU,EAAEhB,EAAEO,SAASV,EAAE,CAACW,MAAM,UAAUC,UAAU,IAAIC,WAAW,IAAIC,OAAO,KAAKxB,KAAKyB,UAAUC,MAAM1B,KAAK2B,MAAM3B,KAAK4B,YAAYhB,KAAKiB,EAAE,CAAC,CAAC,OAAO7B,IAAI,EAAE,SAAS8B,EAAEC,EAAElC,GAAG,OAAO,IAAIH,EAAEqC,EAAElC,EAAE"}