@tianditu/wc
Version:
Web components for tianditu, powered by Demo Macro.
41 lines (36 loc) • 1.17 kB
JavaScript
/*!
* MIT © Demo Macro
*/
;
Object.defineProperty(exports, '__esModule', { value: true });
const index = require('./index-75a53569.js');
const use = require('./use-c678b375.js');
const TdtControlScale = class {
constructor(hostRef) {
index.registerInstance(this, hostRef);
this.position = "bottomleft";
this.color = undefined;
this.uniqueId = undefined;
this.control = undefined;
this.map = undefined;
}
connectedCallback() {
use.onload(() => {
this.map = globalThis[this.uniqueId];
this.control = new T.Control.Scale({
position: this.position,
});
this.map.addControl(this.control);
});
}
componentWillRender() {
use.onload(() => {
this.color && this.control.setColor(this.color);
});
}
render() {
return (index.h(index.Host, { key: '8aadccd6ea8ebf1f0f26bd22e64b45e5555c1f29' }, index.h("slot", { key: 'e71e4d337a9c1de44b13eb205767e3ad6c122f06' })));
}
};
exports.tdt_control_scale = TdtControlScale;
//# sourceMappingURL=tdt-control-scale.cjs.entry.js.map