@tianditu/wc
Version:
Web components for tianditu, powered by Demo Macro.
37 lines (34 loc) • 1.1 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 TdtControlScale = class {
constructor(hostRef) {
registerInstance(this, hostRef);
this.position = "bottomleft";
this.color = undefined;
this.uniqueId = undefined;
this.control = undefined;
this.map = undefined;
}
connectedCallback() {
onload(() => {
this.map = globalThis[this.uniqueId];
this.control = new T.Control.Scale({
position: this.position,
});
this.map.addControl(this.control);
});
}
componentWillRender() {
onload(() => {
this.color && this.control.setColor(this.color);
});
}
render() {
return (h(Host, { key: '8aadccd6ea8ebf1f0f26bd22e64b45e5555c1f29' }, h("slot", { key: 'e71e4d337a9c1de44b13eb205767e3ad6c122f06' })));
}
};
export { TdtControlScale as tdt_control_scale };
//# sourceMappingURL=tdt-control-scale.entry.js.map