@orca-fe/x-map
Version:
23 lines (22 loc) • 529 B
JavaScript
export class AbstractMarker {
setLayer(layer) {
this.layer = layer;
this.updatePosition();
}
}
export default class AbstractLayer {
constructor() {
this.markers = new Set();
}
updatePosition() {
this.markers.forEach((marker) => {
marker.updatePosition();
});
}
setMap(map) {
this.map = map;
// 更新完 map 之后,重新触发该图层的位置更新
this.updatePosition();
}
destroy() { }
}