// import clone from "clone"; import { PicStMapDataPromise } from "../../../../models/_/real"; import BaseLayer from "../baselayer"; import PicStMarker from "./PicStMarker"; export default class PicStLayer extends BaseLayer { static LayerName = 'PicStLayer'; constructor(props) { super(props); this.highlights = {}; } getLayerName() { return PicStLayer.LayerName; } onAdd() { PicStMapDataPromise().then((data) => { this._dispatch.runtime.setMarkers({ [this.getLayerName()]: data || [] }); }); } setSetting(setting) { const highlights = setting?.highlight?.PicStLayer; if (highlights !== this._setting?.highlight?.PicStLayer) { const setting = {}; if (highlights) { for (const h of highlights) { setting[h] = true } } this._dispatch.map.setMarkerSetting({ [this.getLayerName()]: setting, }); } this._setting = setting; } getComponentCls() { return PicStMarker; } }