@tianditu/wc
Version:
Web components for tianditu, powered by Demo Macro.
42 lines (39 loc) • 1.3 kB
JavaScript
/*!
* MIT © Demo Macro
*/
import { r as registerInstance, h, H as Host } from './index-0cd9c6b6.js';
import { o as onload } from './use-ccb66c1b.js';
const TdtControlCopyright = class {
constructor(hostRef) {
registerInstance(this, hostRef);
this.position = "topright";
this.content = undefined;
this.uniqueId = undefined;
this.control = undefined;
this.map = undefined;
}
connectedCallback() {
onload(() => {
this.map = globalThis[this.uniqueId];
this.control = new T.Control.Copyright({
position: this.position,
});
this.map.addControl(this.control);
});
}
componentWillRender() {
onload(() => {
this.content &&
this.control.addCopyright({
id: new Date().getTime().toString(),
content: this.content,
bounds: this.map.getBounds(),
});
});
}
render() {
return (h(Host, { key: 'c47393902b2702af1fa363f28d9fa73a462bbd6a' }, h("slot", { key: 'b68b8a93d66f05646cdd389cd923f5b10a05229d' })));
}
};
export { TdtControlCopyright as tdt_control_copyright };
//# sourceMappingURL=tdt-control-copyright.entry.js.map