@tianditu/wc
Version:
Web components for tianditu, powered by Demo Macro.
46 lines (41 loc) • 1.37 kB
JavaScript
/*!
* MIT © Demo Macro
*/
;
Object.defineProperty(exports, '__esModule', { value: true });
const index = require('./index-75a53569.js');
const use = require('./use-c678b375.js');
const TdtControlCopyright = class {
constructor(hostRef) {
index.registerInstance(this, hostRef);
this.position = "topright";
this.content = undefined;
this.uniqueId = undefined;
this.control = undefined;
this.map = undefined;
}
connectedCallback() {
use.onload(() => {
this.map = globalThis[this.uniqueId];
this.control = new T.Control.Copyright({
position: this.position,
});
this.map.addControl(this.control);
});
}
componentWillRender() {
use.onload(() => {
this.content &&
this.control.addCopyright({
id: new Date().getTime().toString(),
content: this.content,
bounds: this.map.getBounds(),
});
});
}
render() {
return (index.h(index.Host, { key: 'c47393902b2702af1fa363f28d9fa73a462bbd6a' }, index.h("slot", { key: 'b68b8a93d66f05646cdd389cd923f5b10a05229d' })));
}
};
exports.tdt_control_copyright = TdtControlCopyright;
//# sourceMappingURL=tdt-control-copyright.cjs.entry.js.map