import { HDRealPromiseWX2,HDRealPromiseWX3 } from "../../../../models/_/real"; import BaseLayer from "../baselayer"; import HdswAllMarker from "./HdswAllMarker"; export default class HdswAllLayer extends BaseLayer { static LayerName = 'HdswAllLayer'; constructor(props) { super(props); this.highlights = {}; } getLayerName() { return HdswAllLayer.LayerName; } onAdd() { HDRealPromiseWX2.get().then((data) => { // const sh = data.filter(o => o.source==='SH') // const sw = data.filter(o => o.source==='SW') // const sk = data.filter(o => o.source==='SK') HDRealPromiseWX3.get().then((data2) => { const list1 = data||[] const list2 = data2||[] const list = [...list1,...list2] this._dispatch.runtime.setMarkers({ [this.getLayerName()]: list || [] }); }) }); } setSetting(setting) { const highlights = setting?.highlight?.HdswAllLayer; if (highlights !== this._setting?.highlight?.HdswAllLayer) { const setting = {}; if (highlights) { for (const h of highlights) { setting[h] = true } } this._dispatch.map.setMarkerSetting({ [this.getLayerName()]: setting, }); } this._setting = setting; } getComponentCls() { return HdswAllMarker; } }