UNPKG

@tianditu/wc

Version:

Web components for tianditu, powered by Demo Macro.

5 lines 921 B
/*! * MIT © Demo Macro */ import{r as t,h as i,H as s}from"./p-b9380f31.js";import{o as e}from"./p-9e404b55.js";const h=class{constructor(i){t(this,i);this.control=undefined;this.position=undefined;this.visible=true;this.offset=undefined;this.options=undefined;this.uniqueId=undefined;this.map=undefined}connectedCallback(){e((()=>{this.map=globalThis[this.uniqueId];if(!this.control){this.control=new T.Control({position:this.position})}this.map.addControl(this.control)}))}componentWillRender(){e((()=>{this.position&&this.control.setPosition(this.position);this.visible?this.control.show():this.control.hide();this.offset&&this.control.setOffset(this.offset);this.options&&this.control.setOptions(this.options)}))}render(){return i(s,{key:"5d37e1f2f893daf89cb9abafb80b3067b277d28c"},i("slot",{key:"9a7c7f4ea1320a1f48045b26cc9fcd170eaf8ebc"}))}};export{h as tdt_control}; //# sourceMappingURL=p-e8aabd7b.entry.js.map