53 lines
1.1 KiB
JavaScript
53 lines
1.1 KiB
JavaScript
import { DzzhdPromise } from "../../../../models/_/real";
|
|
import BaseLayer from "../baselayer";
|
|
import QSYDWMarker from "./QSYDWMarker"
|
|
|
|
export default class QSYDWLayer extends BaseLayer {
|
|
static LayerName = 'QSYDWLayer';
|
|
|
|
constructor(props) {
|
|
super(props);
|
|
|
|
this.highlights = {};
|
|
}
|
|
|
|
getLayerName() {
|
|
return QSYDWLayer.LayerName;
|
|
}
|
|
|
|
onAdd() {
|
|
DzzhdPromise.get().then((data) => {
|
|
const list = data.map((i)=>{
|
|
return {
|
|
id : i.eicd,
|
|
...i
|
|
}
|
|
})
|
|
this._dispatch.runtime.setMarkers({
|
|
[this.getLayerName()]: list || []
|
|
});
|
|
});
|
|
}
|
|
|
|
setSetting(setting) {
|
|
const highlights = setting?.highlight?.QSYDWLayer;
|
|
if (highlights !== this._setting?.highlight?.QSYDWLayer) {
|
|
const setting = {};
|
|
if (highlights) {
|
|
for (const h of highlights) {
|
|
setting[h] = true
|
|
}
|
|
}
|
|
this._dispatch.map.setMarkerSetting({
|
|
[this.getLayerName()]: setting,
|
|
});
|
|
}
|
|
|
|
this._setting = setting;
|
|
}
|
|
|
|
getComponentCls() {
|
|
return QSYDWMarker;
|
|
}
|
|
}
|